[R] Time series labeling with Zoo

Gad Abraham g.abraham at ms.unimelb.edu.au
Fri Jun 23 09:09:29 CEST 2006

Gabor Grothendieck wrote:
> When the axis labelling does not work well you will have to do it yourself
> like this.  The plot statement is instructed not to plot the axis and then
> we extract into tt all the dates which are day of the month 1.  Then
> we manually draw the axis using those.
> library(zoo)
> set.seed(1)
> z <- zoo(runif(10), as.Date("2005-06-01") + 0:380)
> plot(z, xaxt = "n")
> tt <- time(z)[as.POSIXlt(time(z))$mday == 1]
> axis(1, tt, format(tt, "%d%b%y"))

Thanks Gabor,

That works nicely.


Gad Abraham
Department of Mathematics and Statistics
University of Melbourne
Parkville 3010, Victoria, Australia
email: g.abraham at ms.unimelb.edu.au
web: http://www.ms.unimelb.edu.au/~gabraham

More information about the R-help mailing list