Re: [R] lattice variable by page

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Thu 29 Jul 2004 - 08:08:31 EST

Sundar Dorai-Raj wrote:

>
>
> Matt Pocernich wrote:
>

>> Hi,
>>
>> Using lattice's xyplot, is it possible to specify a variable to group
>> plots by page.  For example, if I have
>>
>> xyplot(y~x|A*B*C)
>>
>> could I get a page created for each unique value in
>> variable C ?  I am hoping to avoid having pages with the same strip above
>> each plot on a page.
>>
>> Thanks,
>>
>> M
>>

>
> Others may have a better solution, but when I've done this in the past I
> used a for loop with subset:
>
> # assuming C is a factor to use nlevels
> for(ci in nlevels(C)) {
> pl <- xyplot(y ~ x | A * B,
> subset = C == ci,
> main = paste("C ==", ci))
> print(pl)
> }
>
> HTH,
> --sundar
>

Sorry made a typo: "nlevels" should be "levels".

--sundar



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 29 08:17:56 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:20 EST