[R] Creating a scatterplot with sequential dates on x-axis?

Duncan Mackay mackay at northnet.com.au
Mon Aug 8 02:09:36 CEST 2011


Try
library(lattice)
x = seq(from = as.Date("2011-01-01"), by = "1 month", length = 10)
y = rnorm(10)
xyplot(y~x)
?xyplot
?seq

Regards

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
ARMIDALE NSW 2351
Email: home mackay at northnet.com.au


At 10:00 08/08/2011, you wrote:
>Hi all.
>
>I need to plot 30 values and I'd like the x-axis to have 30 dates values,
>e.g., 5/1/2011, 5/2/2011, etc. so an observer could see how the values
>correspond as the month progresses.
>
>Is there a convenient function I could use? I considered creating two
>vectors, x and y, then simply plotting those.
>
>Thanks,
>
>~Caitlin
>
>         [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list