Skip to content
Prev 194728 / 398500 Next

Access to conditioning variables (lattice)

If your panel function has an argument called 'subscripts' then
xyplot will pass it the row numbers of the data argument that
correspond this the current panel.   E.g.,

   > xyplot( y ~ x | Type, dataset, 
   +         panel = function(..., subscripts) {
   +             panel.xyplot(...)
   +             cat("subscripts=", deparse(subscripts), ":\n")
   +             print(dataset[subscripts,])
   +         })
   subscripts= 1L :
      x y Type
   1 1 4    a
   subscripts= 2L :
      x y Type
   2 2 5    b
You can use that information to add panel-specific information
to the plot.

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com