[R] xyplot question

Christoph Scherber Christoph.Scherber at uni-jena.de
Tue Dec 6 18:30:06 CET 2005


Dear R users,

I have a question regarding the use of xyplot in the lattice() package. 
I have two factors (each with two levels), and I´d like to change the 
order of the panels in a 2x2 panel layout from the default alphabetic 
order that R uses based on the names of the factor levels.

My approach is (in principle)

xyplot(y~x|Factor1+Factor2)

Let´s assume, my factor levels for Factor1 are A and B,
and for Factor2 they´re C and D, respectively.

Now the default arrangement of my panels would be (from bottom top left 
to bottom right): "BC","CA","BD","AD"

What I´d like to have is "BD","AC","BC","AD".

Can anyone tell me how to solve this problem easily?

I´ve read that using "perm.cond" and/or "index.cond" could solve this 
problem, but couldn´t find an appropriate example, unfortunately...

Thank you very much for your help!

Regards,
Christoph




More information about the R-help mailing list