I am trying to build an xts object, but I am getting years error message. The xts object has only a numeric value and a POSIXct index. Below is the code that shows xts and an error when trying to plot. Any ideas on what needs to be done for the xts object to print correctly?
xTest<-as.xts(35, Sys.time()) xTest ## [,1] ## 2013-04-07 18:19:19.37238 35 class(xTest) ## [1] "xts" "zoo" class(index(xTest)) ## [1] "POSIXct" "POSIXt" plot(xTest) ## Error in if (on == "years") { : missing value where TRUE/FALSE needed
source share