[R] lattice -- panel order display
Deepayan Sarkar
deepayan at stat.wisc.edu
Tue Mar 1 17:08:28 CET 2005
On Tuesday 01 March 2005 08:50, Luis Ridao Cruz wrote:
> R-help,
>
> I'm using 'xyplot' in lattice package which plots length frecuencies
> by year (10).
> The order I get is not logical and the 'index.cond' argument to
> 'xyplot' is a bit cumbersome when it comes to plot a great deal of
> (in my case years).
>
> I have tried sorting the conditioning variable but still get the same
> result.
>
> Is there any easy way to do it without making use of 'index.cond' ?
>
> The function call is as follows:
>
> xyplot ( number ~ cm | as.factor(test$year) , data=test)
The order of panels would be the same as you would get by
> levels(as.factor(test$year))
So what you really need to figure out is how to explicitly specify the
order of levels when creating a factor. In other words, this is not a
lattice issue.
How best to do this depends on details you haven't given, specifically,
what you think the 'logical' order is. Reading ?factor
and ?reorder.factor might help.
-Deepayan
More information about the R-help
mailing list