Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Bert Gunter
x <- rep(1:10,4) y <- runif(40) z <- sample(letters[1:4],40,rep=TRUE) grp <- sample(LETTERS[1:2],40,rep=TRUE) xyplot(y~x|z, group=grp, panel = panel.superpose, panel.groups = function(...){ panel.xyplot(...) panel.lmline(...) }) Keys (legends), colors, line styles,etc, can all be cu

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread ilai
On Wed, Apr 18, 2012 at 2:07 PM, Louis Plough wrote: > If you could lead me to an example with code, that would help me figure out > how to do it for my function The states example in ?xyplot uses groups and subscripts in a panel function >> I read it, but I guess I don't quite understand which

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Richard M. Heiberger
please look at the ancova function in the HH package. On Wed, Apr 18, 2012 at 3:34 PM, Louis Plough wrote: > Hi, > I am trying to use xyplot to plot the relationship between size and day > (y~x) by a food factor that has two levels, low and high. I have 3 reps per > factor/day. I want the plot

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Louis Plough
If you could lead me to an example with code, that would help me figure out how to do it for my function On Wed, Apr 18, 2012 at 3:57 PM, Louis Plough wrote: > I read it, but I guess I don't quite understand which arguments to pass > panel.groups to get different lm objects based on the two gro

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Bert Gunter
Please read ?panel.superpose again and pay attention to the panel.groups argument, where this can be specified. -- Bert On Wed, Apr 18, 2012 at 12:34 PM, Louis Plough wrote: > Hi, > I am trying to use xyplot to plot the relationship between size and day > (y~x) by a food factor that has two lev

[R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Louis Plough
Hi, I am trying to use xyplot to plot the relationship between size and day (y~x) by a food factor that has two levels, low and high. I have 3 reps per factor/day. I want the plots from each food treatment on the same axiss, so I used this code: xyplot(Size ~ Day, groups = Food, data = louis.data