[R] Lattice: problem using panel.superpose and panel.groups

Dieter Menne dieter.menne at menne-biomed.de
Sun Aug 17 11:36:11 CEST 2008


Michael Braun <braunm <at> MIT.EDU> writes:

> 
> Dieter:
> 
> Thank you for your response.  As you requested, I created a self- 
> running example, pasted below.  It may be a little wordier than I  
> would like, but it runs.

.. Details removed
> 
> panel.ppc.plot <- function(...,group.number) {
> 
>    if (group.number==1) {
>      panel.bwplot(...)
>    } else {
> 
>      panel.lines(...)
>    }
> }

Trellis graphics are a bit like hash functions: you can be close to the 
target, but get a far-off result. I admit that I do not know why 
panel.lines does not work in the above example, but  

panel.polygon(...)

works in your special case of ordered data. More generally, I would suggest 
to use

panel.xyplot(x,y,type="l")

or, if you want the ... notation, 

panel.xyplot(...)

but then you have to set type="l" in your bwplot calling function.

Dieter



More information about the R-help mailing list