Thanks Baptiste, your suggestion works wonderfully.  Bryan

For anyone following along, the following line needs to replace the similar
one in my original example:
names <- rep(c("Set 1", "Set 2", "Set 3", "Set 4"), 25)
Or the data lengths will be wrong.



On 9/7/09 4:19 PM, "baptiste auguie" <baptiste.aug...@googlemail.com> wrote:

> Hi,
> 
> Something like this perhaps,
> 
> p <- xyplot(y ~ x | names,
>    layout = c(1, 3),
>    panel = function(...,type="p") {
>        if (panel.number() == 1) {
>          panel.xyplot(...,type = "h")
>           } else {
>          panel.xyplot(...,type = type)
>          }
>        })
> 
> plot(p)
> 
> HTH,
> 
> baptiste
> 
> 2009/9/7 Bryan Hanson <han...@depauw.edu>
>> Hello R Folks...
>> 
>> Using the example below, Iąd like two of the panels to be plotted with type
>> = łp˛ but the third to be done with type = łh˛.  I canąt use type = 
>> c(łp˛,
>> łp˛, łh˛) because this syntax applies all given types to every panel  I
>> donąt think I can use groups and distribute.type because these are intended
>> for different styles of plotting within a single panel.  As you can see, I
>> tried to do a panel function following something I saw in the Lattice book,
>> but this has no effect at all.  Looks like it may have to be more elaborate,
>> but Iąm stuck.  Any suggestions appreciated!
>> 
>> Thanks, Bryan
>> *************
>> Bryan Hanson
>> Professor of Chemistry & Biochemistry
>> DePauw University, Greencastle IN USA
>> 
>> 
>> y <- rnorm(100)
>> x <- rnorm(100)
>> names <- rep(c("Set 1", "Set 2", "Set 3"), 4)
>> df <- data.frame(y = y, x = y, names = as.factor(names))
>> p <- xyplot(y ~ x | names,
>>     layout = c(1, 3),
>>     panel = function(...) {
>>         panel.xyplot(...)
>>         if (panel.number() == 1) type = "h"
>>         })
>> 
>> plot(p)
>> 
>>         [[alternative HTML version deleted]]
>> 
>> 
>> ______________________________________________
>> 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.
>> 
> 
> 


        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to