[R] Controlling Order of Panels in Lattice Trellis Plots
petr.pikal at precheza.cz
Mon Feb 25 07:33:36 CET 2013
> -----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
> >  a b c
> > Levels: a b c
> >> y <- factor(x,lev=letters[3:1]) ## reorder the levels y
> >  a b c
> > Levels: c b a
> 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.
> Thanks again,
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help