[R] zoo timeseries plot; minor tic mark level control

Alex van der Spek doorz at xs4all.nl
Mon Nov 26 12:36:16 CET 2012


I cannot figure out how to tune the minor tic marks on the date axis of a
zoo plot.

I read hundreds of CSV files from a zip archive transparently. The
time/date strings I convert to POSIXct format, order them and then make a
zoo object as there may be cases which have unequal time stamping. As
follows:
######################
#Transform timestamps and reorder them
dat <- transform(dat, Timestamp = as.POSIXct(Timestamp, format = "%m/%d/%Y
%H:%M:%S", tz ="Europe/Paris"))
dat<-dat[order(dat$Timestamp),]

#Make a zoo object
zdt <- zoo(dat[,2:4], dat$Timestamp)

#Plot
plot.zoo(zdt,main=mttl,xlab=NULL,panel=panel.yaxis,
         yaxt='n',type = 'l',cex=0.2)
#####################

The plot is easy. For this data the timestamping is every 5 seconds over
many weeks (2 to 3 months). The standard tic mark labeling I get with the
plot.zoo() is just the abbreviated name of the month (Oct and Nov). How
can I add minor tic marks for the individual days?

All and any help or pointers welcome.
Alex van der Spek



More information about the R-help mailing list