[R] axis command and excel time format

Carmen Meier
Wed, 08 Nov 2006 14:39:07 -0000

Gabor Grothendieck schrieb:
> Is the problem how to produce an axis with a given minimum tick,
> maximum tick and given number of ticks?  In that case try this
yes but ... ;-)
I started with an plain R gui

library(zoo)
library(chron)
# input data
# z is from original example
mn <- times("23:00:00")
mx <- times("23:55:00")
n <- 12
z <-(1:50)
xt <- times(seq(mn, mx, length = n))
plot(z, xaxt = "n")
axis(1, xt, sub(":00$", "", xt))


The result is an X-axes with 23:00 at the left side nothing else at the
x-axis
That`s just the same problem as I got with further trials of my own
and a minor problem will be sub(":00$", "", xt)) if
times(seq(mn, mx, length = n)) will not result
xx:yy:00 values only (f.e n=17)

Regards Carmen