Hi > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Rich Shepard > Sent: Friday, February 22, 2013 11:33 PM > To: r-help@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@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. ______________________________________________ R-help@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.