[R] Surpress one panel in lattice plot..?

Ben Bolker bolker at ufl.edu
Mon Aug 24 02:41:21 CEST 2009

Fredrik Karlsson wrote:
> Dear list,
> I have a two character vector with two different values in them (two
> each, that is). Naturally, when I use these vectors as grouping
> factors in a lattice plot, I get four panels.
> Now, one of the possible four combinations will never have data, so
> one panel will always be empty. So now my question is: can I force R /
> Lattice not to print it, and give me only the 3 filled panels?
> I have tried adding "layout=c(3,1)" to the list of arguments, but that
> gives me one plot that looks like I want it to, and then a new plot
> with just the empty panel. I use this in an odfWeave document, so just
> getting the last (empty) plot in the output is not really what I want.
> I do of course appreciate all the help I can get on this.

One possibility would be to assign the factor interaction explicitly
to a variable  (mydata$interact = with(mydata,interaction(f1,f2)) or f1:f2) 
and group by the interaction (which
will be missing the empty group) rather than by the two groups

  Ben Bolker

View this message in context: http://www.nabble.com/Surpress-one-panel-in-lattice-plot..--tp25108072p25108944.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list