Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfutures.expiry() fails #257
Comments
It's not clear how long these functions have been broken. The source of the break started in 2008, when Jeff removed the generics and methods for years(), quarters(), months(), etc. This might have been okay for awhile, but perhaps S3 dispatch has become more restrictive since then (e.g. a guess: methods in packages must be registered, not just named like a S3 method). The fix appears to be simple: use .indexmon() to replace the defunct months.xts() method that isn't registered. Also delete the months.xts() method to avoid more confusion. Fixes #257.
|
Thanks for the report! It looks like the cause of this issue was removing S3 generics and methods for I just pushed a commit. I would really appreciate if you could test it to ensure it works for your situation! |
|
I installed quantmod from the 257-expiry branch and the futures.expiry() function works just fine now. Thanks! |
|
I'm not sure of the protocol... the problem seems to be fixed in the 257-expiry commit but should I have waited until you pushed this fix into the master before rating the problem Closed? Thanks! |
|
Thanks for the testing and feedback! You don't need to close the issue. It would have been closed when I merged the branch into master. No worries though! |
xis an xts time series and when calling:futures.expiry(x), a warning is thrown and the result is empty. I was expecting the indices of the futures expiration dates.It seems that the
months.xts()function (frommonths.R) isn't defined in my session (althoughfutures.expiry()is defined). I can work around the problem by redefiningfutures.expiry()as:Here's a minimal session that reproduces the problem on my system:
This results in the following:
Session Info: