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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.