Skip to content
Prev 342916 / 398506 Next

lattice scales format dates

Thanks David.
Much appreciated.


-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net] 
Sent: August-06-14 2:31 PM
To: Folkes, Michael
Cc: r-help at r-project.org
Subject: Re: [R] lattice scales format dates
On Aug 6, 2014, at 1:11 PM, Folkes, Michael wrote:

            
Which says very little about barchart in particular but rather refers
you to 

?panel.barchart

It's really designed expecting  x to be a factor,
Probably would have if you were using xyplot. But barchart's author
assumed that the "x-axis" is a set of disjoint values and that's not
really how datetimes are generally considered. Try this:

 barchart(var1~factor(format(date.val, "%Y-%b")), data=dat,
horizontal=F,
          scales=list(x=list(rot=45) ) )
And learn to post in plain text.
David Winsemius
Alameda, CA, USA