Forum: help


RE: Subsetting xts object breaks the index and modifies dates [ Reply ] By: Joshua Ulrich on 2017-04-02 16:20 | [forum:45069] |
I cannot replicate your results using either 0.9-7 from CRAN or the latest commit from GitHub. I suspect there's something wrong with your local installation. The output from sessionInfo() might help diagnose. |
Subsetting xts object breaks the index and modifies dates [ Reply ] By: Marshall Feldman on 2017-04-02 16:15 | [forum:45068]![]() |
This is either a bug or a very vicious trap for the unwary. In brief, use [,] to subset of an xts object whose index is yearqtr. The index class becomes NULL, but the index itself is fine. Then change the subset's index class, and the class looks fine, but the dates in the index are changed. I've not investigated whether this happens if the original index is something other than yearqtr. I've attached some code that demonstrates this. |