[R] Possible bug in plot.POSIXct regarding x axis

Karl Ove Hufthammer karl at huftis.org
Mon Oct 19 12:04:48 CEST 2009


I believe I have found a bug (or at least a misfeature) in plot.POSIXct. 
See the following example code.

set.seed(1)
x=seq(1,1e8,length=100)+round(runif(100)*1e8)
y=as.POSIXct(x,origin="2001-01-01")
plot(y)

This plots some random (date)times against their indices. The y axis 
correctly shows appropriate values (years), but the x axis contains the 
single number '59:58' in the lower left corner, which makes no sense.

Compare this to a simple 'plot(x)', which shows the index numbers on the 
x axis.

I observe this with both R 2.9.2 and 2.10.0 alphas.

If anybody can confirm that this should be considered a bug, I'll report 
it in the bug system.

-- 
Karl Ove Hufthammer




More information about the R-help mailing list