[R] Simple lattice question

Rubén Roa rroa at azti.es
Thu Mar 31 12:39:03 CEST 2011


DeaR ComRades,

require(lattice)
data <- data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)),
                   x=rpois(60,10),
                   y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5),
                   z=rep(1:4,15))
xyplot(x~y|SP,data=data,groups=z,layout=c(2,3),pch=1:4,lty=1:4,col='black',type='b')

How do I put a legend for the grouping variable in the empty upper-right panel?

TIA

Rubén

____________________________________________________________________________________ 

Dr. Rubén Roa-Ureta
AZTI - Tecnalia / Marine Research Unit
Txatxarramendi Ugartea z/g
48395 Sukarrieta (Bizkaia)
SPAIN



More information about the R-help mailing list