Please forgive my ignorance on grapics. I'm trying to make a relatively simple plot with two line plots, same axes, by mean over a series of dates. I can make the plot well like this: plot(sort(tapply(first.anti.auth.sum,date,mean), partial=1), type="l", col="yellow",ylim=c(0,2.0)) par(new=TRUE) plot(sort(tapply(first.pro.auth.sum,date,mean), partial=1), type="l", col="red",ylim=c(0,2.0)) but I would like the X axis to be dates, not index numbers. The trick is that the "date" column across which the means are calculated returns integers; I'd like to use, effectively: format.POSIXct(as.POSIXct(date), '%b %d') ...but don't know how to make that happen. Thanks for any advice. ---------------------------------------------------------------------- Andrew J Perrin - http://www.unc.edu/~aperrin Assistant Professor of Sociology, U of North Carolina, Chapel Hill clists at perrin.socsci.unc.edu * andrew_perrin (at) unc.edu
plot(sort(tapply(first.anti.auth.sum,date,mean), partial=1), type="l",
col="yellow",ylim=c(0,2.0))
par(new=TRUE)
\\ par(xaxt='n')
plot(sort(tapply(first.pro.auth.sum,date,mean), partial=1), type="l",
col="red",ylim=c(0,2.0))
check up ?mtext()
but I would like the X axis to be dates, not index numbers. The trick is
that the "date" column across which the means are calculated returns
integers; I'd like to use, effectively:
format.POSIXct(as.POSIXct(date), '%b %d')
...but don't know how to make that happen.
Thanks for any advice.
----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists at perrin.socsci.unc.edu * andrew_perrin (at) unc.edu
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
This message and any attachments (the "message") is\
intende...{{dropped}}