[R] xyplot() question

Christoph Scherber Christoph.Scherber at uni-jena.de
Thu Feb 10 16:34:59 CET 2005


Dear R Users,

I have an xyplot() where different plotting symbols are used for 
subgroups (originally used within S-Plus, but hopefully it´s also 
applicable to R users).
 How can I fit separate regression lines for every subgroup? So far, I 
can only plot the overall fitted line.

The code looks like this:

trellis.device()
sps<-trellis.par.get("superpose.symbol")
sps$pch<-1:7
trellis.par.set("superpose.symbol",sps)

spl <- trellis.par.get("superpose.line")  
ps$lty <- 1:7 
trellis.par.set("superpose.line",spl)         
xyplot(a~b|factor+treatment,
groups=external,data=ownframe,layout=c(2,2),
panel=function(x,y,subscripts,...){panel.superpose(x,y,subscripts,...);panel.lmline(x,y)}) 


Thank you very much for your help!

Regards
Christioph




More information about the R-help mailing list