You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shift.time is an exported function of xts, but if you try to use it, it will result in an error.
Error in UseMethod("shift.time") :
no applicable method for 'shift.time' applied to an object of class "c('xts', 'zoo')"
Expected behavior
shift.time.xts is the underlying function called when you have an xts object and you want to shift the time by n seconds.
Reason
I found that the reason why this doesn't work is that shift.time.xts is not exported as an s3 method in the namespace. Adding S3method(shift.time, xts) to the namespace will resolve this issue.
Thanks for the report! I agree this is a bug, and agree with your proposed solution. Would you like to create a PR to add S3method(shift.time, xts) to NAMESPACE?
Description
shift.time is an exported function of xts, but if you try to use it, it will result in an error.
Expected behavior
shift.time.xts is the underlying function called when you have an xts object and you want to shift the time by n seconds.
Reason
I found that the reason why this doesn't work is that shift.time.xts is not exported as an s3 method in the namespace. Adding
S3method(shift.time, xts)
to the namespace will resolve this issue.Minimal, reproducible example
Following code will result in the error
using the following code, the shift works
xts:::shift.time.xts(df1_xts, n = 60)
Session Info
The text was updated successfully, but these errors were encountered: