[R] question on xyplot
Zhongming Yang
zhongmingyang at yahoo.com
Tue Mar 15 19:58:13 CET 2005
Dear All:
In the attached file, I have 3 group patients, and there are 5 in each group (the groups are decided by the prefix of the idno). I want draw a repeat measurement comparison figure. My goal is to list 5 patients from same group on one horizontal line. But xyplot sounds pick them randomly (or I was confused?). Could you please help me modify the following code to accomplish this?
Thanks
Zhongming Yang
library(nlme)
library(lattice)
md <- read.table('../data/sample.txt', header=T)
md <- groupedData(md ~ month | idno, data=md)
trellis.device(theme=col.whitebg())
xyplot(md ~ month | idno, data=md, main="title",
xlab="x", ylab="y", layout=c(5, 3),
panel=function(x, y){
panel.xyplot(x, y)
panel.lmline(x, y, lty=2)
}
)
---------------------------------
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sample.txt
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050315/abec4779/sample.txt
More information about the R-help
mailing list