Plot xts Error in if (on == "years") {: missing value where TRUE / FALSE is required

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 
+4
source share
1 answer

What is your goal? Is there a problem that the plot.xts function plot.xts not display less than 3 points? The error is generated by xts::axTicksByTime because the minimum number of breaks is 2. Attempts to pass another argument to axTicksByTime frustrated by the encoding in plot.xts , which has no mechanism ...

+4
source

All Articles