[R] problem with chron scales in lattice

Waichler, Scott R Scott.Waichler at pnl.gov
Wed Jun 1 21:29:18 CEST 2005


> > I can't get the scales parameter in xyplot of lattice to work as I 
> > expected.  I'm using R-2.1.0 and lattice 0.11-8.  There should be
year 
> > labels from 1992 to 2004 for the x axis in the plot below, but
instead 
> > only a few of them appear, and in the wrong spots, as if the 
> > coordinate system has changed after finishing with the panel
function.

> I'll try to figure out what the problem is. A temporary 
> workaround is to 
> explicitly coerce x.limits and x.at to numeric:
> 
>     ...
>     xlim = as.numeric(x.limits),
>     scales = list(x = list(alternating = T, 
>                   at = as.numeric(x.at), 
>                   labels = x.labels, tck=0)),
>     ...

Thanks, Deepayan.  I thought I had already thoroughly tried as.numeric
around the chron objects, but apparently not.  

Scott Waichler




More information about the R-help mailing list