[R] Controlling Order of Panels in Lattice Trellis Plots

PIKAL Petr petr.pikal at precheza.cz
Mon Feb 25 07:33:36 CET 2013


Hi

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Rich Shepard
> Sent: Friday, February 22, 2013 11:33 PM
> To: r-help at r-project.org
> Subject: Re: [R] Controlling Order of Panels in Lattice Trellis Plots
> 
> On Fri, 22 Feb 2013, Bert Gunter wrote:
> 
> > You do not need to use ordered factors.
> > newfac <- factor(oldfac, lev= ...) ## will do it. e.g.
> >
> >> x <- factor(letters[1:3]) ## default ordering is alphabetic (mod
> >> locale) x
> > [1] a b c
> > Levels: a b c
> >> y <- factor(x,lev=letters[3:1])  ## reorder the levels y
> > [1] a b c
> > Levels: c b a
> 
> Bert,
> 
>    Makes sense. I wonder if this will work when only a portion of the
> site IDs need to be explicitly ordered. There are 64 sites in all.
> Might be easier to sort the text file.

Any sorting of input text file do not change factor levels ordering in R which is by default alphabetic. 

Do not guess how the language works, learn the rules from documentation and help pages.

If you learned some foreign language you need to know some vocabulary and grammar to express understandable thoughts. And mostly people are more intelligent than computers when dealing with incomplete and twisted sentences. 

Regards
Petr
> 
> Thanks again,
> 
> Rich
> 
> ______________________________________________
> 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