On Mon, Aug 4, 2008 at 8:44 AM, Mark Difford <[EMAIL PROTECTED]> wrote: > > Hi Michael, > >>> Pulling my hair out here trying to get something very simple to work. ... > > I can't quite see what you are trying to do [and I am not sure that you > clearly state it], but you could make things easier and simpler by (1) > creating a factor to identify your groups of rows more cleanly and (2) by > using the groups= argument in lattice. > > ## Something along these lines > copyDat <- originalDat > copyDat$newFac <- gl(2, 387, 774, labels=c("A","B")) > > xyplot(response ~ predictor|maybe.condition, data=copyDat, groups=newFac)
Right, and using 'row' directly should also work (although not with as good possibilities for annotation): xyplot(response ~ predictor|maybe.condition, data=copyDat, groups=(row <= 387), type = c("l", "g")) If you need a custom panel function, try using panel.groups: xyplot(response ~ predictor|maybe.condition, data=copyDat, groups=(row <= 387), panel = panel.superpose, panel.groups = function(...) { panel.grid(h = -1, v = -1, lty = 3) panel.lines(...) }) -Deepayan ______________________________________________ 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.