Hello, I've created an xyplot and I want to add a loess line for x (Age) <=40 and another for values >40. In a way it is similar to this https://stat.ethz.ch/pipermail/r-help/2009-May/390502.html but still not succcessful. This is my try:
xyplot(MOE~Age|Species, groups=Site, panel = function(x, y, groups=groups,...) { panel.xyplot(x, y, groups=groups,...) panel.loess(x,y,subset = x <= 40, col="black") panel.loess(x,y,subset = x >40, col="red") }) When I run the code it "works" but it plots the loess line for all the data, without subsetting.Any suggestion? Thank you [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.