-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
As of version 0.12 apply.period functions have started reindexing time-variable #330
Comments
Thanks for the report! I can replicate, and will investigate. |
I ran #!/bin/sh
make -B install
Rscript -e 'quit("no", inherits(zoo::index(xts::apply.daily(xts::xts(1:10, .Date(1:10)), sum)), "POSIXt"))' Which found:
|
This was caused by the issue documented in #322. This issue no longer exists on master, now that the 322 issue branch is merged, so I'm closing this. Thanks again for the report! R> packageVersion("xts")
[1] '0.12.0.1'
R> t <- xts(order.by = c(as.Date("2020-01-01"),as.Date("2020-02-01")), x = matrix(0,2,2))
R> # always gives Date
R> class(index(t))
[1] "Date"
R> # gives posixct under 0.12, date under 0.11.2
R> class(index(apply.daily(t,sum)))
[1] "Date" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I changed from version 0.11.2 to 0.12, and noted the following new behavior. Because it is not mentioned in the changelog, and does not really make sense to me I believe this is a bug that risks causing all kind of weird bugs for users downstream.
Expected behavior
If you pass an xts indexed by Date into a period.apply function, I would expect it to come out as a Date-indexed one, but as of 0.12 it appears to transform into a posixct. eg.
Minimal, reproducible example
The text was updated successfully, but these errors were encountered: