Skip to content
Prev 241813 / 398500 Next

format secondary axis for dates

On Nov 16, 2010, at 2:32 PM, Jannis wrote:

            
The origin argument was incorrect and you got the wrong starting point:
 > x[1]
[1] "0001-01-19 01:00:00 EST"
This gives ticks at hourly intervals:

axis(3, labels=format(x, "%Y-%m-%d"), at=x)

Whereas this is probably what you want (after correcting the origin to  
"1970-01-01"

axis.POSIXct(3, x=x, labels=TRUE )