[R] format secondary axis for dates

Jannis bt_jannis at yahoo.de
Tue Nov 16 20:32:02 CET 2010


Dear List,


this may be a Newbi question and may have been asked several times, but i am too stupid to find the posts.


I have a plot of values against POSIXct time steps. If I want to add a second x axis to the top margin of the plot, only numbers are at the tickmarks. Is there a straightforward way to specify the format to convert them to character representations (similar to the labels at the bottom)?

x<-as.POSIXct(1:1000*(60^2),origin='01-01-1970')
y=rnorm(1000)
plot(x,y)
axis(3)


Thanks for your help
Jannis

 





More information about the R-help mailing list