[R] lattice xyplot, get current level

David Winsemius dwinsemius at comcast.net
Tue Oct 2 20:04:06 CEST 2012


On Oct 2, 2012, at 3:59 AM, Christof Kluß wrote:

> Hi
> 
> xyplot(y ~ x | subject) plots a separate graph of y against x for each
> level of subject. But I would like to have an own function for each
> level. Something like
> 
> xyplot(y ~ x | subject,
>       panel = function(x,y) {
>         panel.xyplot(x,y)
> 
>         panel.curve(x,y) {
>           # something that dependents on the current subject
>           ...
>         }
>       })
> 

This seems to be different question than what you later requested. This question would seem to be documented in the 'panel' section of help(xyplot) in particular the paragraph beginning with this sentence:

"One can also use functions called panel.number and packet.number, representing panel order and packet order respectively, inside the panel function (as well as the strip function or while interacting with a lattice display using trellis.focus etc). "

-- 

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list