[R] A Lattice Question
Haoda Fu
fuhds at yahoo.com.cn
Wed Jul 8 23:47:46 CEST 2009
To the Lattice expert -
I am new to the lattice package and I would like to add a curve to the
xyplot(). I know that I need to use panel function to add it. But it doesn't work. Is there anyone can help me out on how to transfer the data into the function?
The following is my code and I would like to add lines for xx,yy
xx <- seq(0,1,length = 100);
yy <- mean(PS$theta)*(1-exp(mean(PS$k)*xx))/(1-exp(mean(PS$k)))
ts1 <- xyplot(VCFB ~ Visit , groups = ID, data = CFB_M, type = c('g','l'),strip = strip.custom(style =4), as.table=TRUE,xlab = 'Time',ylab = 'FBG CFB',main = '3mg Change from Baseline FBG',panel=function (xx,yy,...) {
panel.xyplot(...);
panel.lines(xx,yy,...);});
Many thanks!!
Best,
Haoda
More information about the R-help
mailing list