Hi All, I am trying to understand panel functions. Let's use this example.
library(lattice) time<-c(rep(1:10,5)) y <-time+rnorm(50,5,2) group<-c(rep('A',30),rep('B',20)) subject<-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10)) myData <-data.frame(subject,group,time,y) head(myData) Plot 1 xyplot(y ~ time | group, data = myData, groups = subject, panel = panel.superpose, panel.groups = function(...) panel.loess(...) ) Plot 2 xyplot(y ~ time | group, data = myData, groups = subject, panel = function(...) { panel = panel.superpose(...) panel.groups = function(...) panel.loess(...) }) Why does Plot 2 not produce the loess curves? Why are points not plotted on Plot 1? Plot 3 xyplot(y ~ time | group, data = myData, groups = subject, panel = function(...) { panel.superpose(...) panel.superpose(panel.groups = panel.loess, ...) }) What is the effect of writing panel.superpose twice? What is it about this call that makes the data points appear on the graph? Thanks, Juliet ______________________________________________ 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.