[R] Drawing a line in xyplot

wcheckle wcheckle at jhsph.edu
Sat Apr 7 17:35:38 CEST 2012


here is the data (fyi this is made-up data)

x = as.data.frame (
cbind(c(5,8,7,5,8,10,11,6,4,5,20,25,27,30,35,32,28,21,20,34,11,15,18,12,15,12,10,15,19,20),
c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3),c(1,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,0,0)))
names(x)=c("mortality","type","attend")

here is the image:
http://r.789695.n4.nabble.com/file/n4539596/x.jpg 

revised code with image:

x11(height=8,width=11)
xyplot ( mortality ~ factor(attend)|type,
panel=function(x,y){panel.grid(lty=5);
panel.xyplot(x,y,pch=16,jitter.x=TRUE,col=1)},
strip=strip.custom(which.given=1, bg="orange"),data
=x,aspect=2:1,layout=c(3,1)) 

http://r.789695.n4.nabble.com/file/n4539596/x1.jpg 

i am trying to replicate the "red" mean lines on the xyplot graph

abline won't do it.  llines may be able to do it, but i don't know how to
use/implement

thanks



--
View this message in context: http://r.789695.n4.nabble.com/Drawing-a-line-in-xyplot-tp4538689p4539596.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list