-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
futures.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! |
x
is 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:
The text was updated successfully, but these errors were encountered: