xts
xts copied to clipboard
plot.xts fails if index is POSIXlt with 3-element tzone
As documented in ?DateTimeClasses:
"POSIXlt"objects will often have an attribute"tzone", a character vector of length 3 giving the time zone name from theTZenvironment variable and the names of the base time zone and the alternate (daylight-saving) time zone. Sometimes this may just be of length one, giving the time zone name.
plot.xts currently fails if you call it on an xts object with a 3-element tzone attribute.
tz3 <- c("","CST","CDT")
x <- xts(1:10, as.POSIXlt(Sys.Date()-10:1, tz=tz3), tzone=tz3)
plot(x)
# Error in as.POSIXlt.POSIXct(.POSIXct(.index(x)), tz = indexTZ(x)) :
# invalid 'tz' value