[R] xyplot multiple conditions and empty panels

Sebastien Bihorel Sebastien.Bihorel at cognigencorp.com
Fri Feb 6 22:15:44 CET 2009


Dear R-users,

Is it possible to prevent xyplot from drawing empty panels when using 
multiple conditions and when the dataset has a incomplete set of 
condition combinations - like in the following example?
I have tried to modify the drop.unused.levels argument but without any 
success.
Any help and suggestions will be appreciated.

Sebastien

####
df <- data.frame(id=c(1,1,2,2,1,1,3,3,4,4),
                 grp=c(1,1,1,1,2,2,2,2,2,2),
                 x=1:10,
                 y=1:10,
                 z=jitter(1:10))
xyplot(y+z~x|id*grp,
       data=df,
       type=c("p","l"),
       distribute.type = T,
       pch=3,
       col=c(1,2),
       xlab="x axis",
       ylab="y axis")
####




More information about the R-help mailing list