Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tclass and class if index has no attr
Some users may set the index using attr<- instead of using the API, as they should. This may result in a malformed index (e.g. a numeric vector with no tclass or tzone attributes). This can cause errors in other xts code. This commit fixes the case where a call to index() on a malformed xts object throws an error at the switch() statement, because value[[1]] is "". This case breaks existing code in the twsInstrument package. Throw a warning to let users know they're being naughty, and set the tclass and class to POSIXct to avoid breaking things downstream. Fixes #297.
- Loading branch information