[R] densityplot on date objects

Jack T. jackt at fpc.org
Fri Jul 23 20:41:19 CEST 2010


Hi, I'm looking for a way to use densityplot in the lattice package on Date
data or manipulate the labels for tick marks.

Here's an example:
#generate psuedo dates
dat.Date  <- as.Date('2009-12-31')+as.integer(abs(rnorm(10000))*100)
  #convert to a julian date for densityplot
  #because it doesn't do Date or POSIX.. objects
  densityplot(as.numeric(format(as.Date(dat.Date), "%j")), plot.points=F)

My conversion to julian date here was only to 'force' densityplot to plot
some Date data

My question specifically is:

How could I express the X axis in this figure as Dates 
perhaps sequenced by month (e.g. '2010-01-01', '2010-02-01', etc).

I could do this with the base R graphics but am at a loss with lattice
densityplot.

Thanks for any advice in advance!

JT

-- 
View this message in context: http://r.789695.n4.nabble.com/densityplot-on-date-objects-tp2300570p2300570.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list