[R] Controlling Order of Panels in Lattice Trellis Plots

Bert Gunter gunter.berton at gene.com
Fri Feb 22 22:42:52 CET 2013


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

On Fri, Feb 22, 2013 at 1:22 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> On Fri, 22 Feb 2013, Bert Gunter wrote:
>
>> Manually change the ordering of the levels in the factor to that which you
>> want (see ?factor if necessary) and replot.
>
>
> Bert,
>
>   I'll do this.
>
>   I looked at ?factor and will try is.ordered() to see if that makes a
> difference.
>
> Many thanks,
>
> 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list