Skip to content
Prev 263172 / 398502 Next

Accessor functions in lattice graphics

On Mon, Jun 20, 2011 at 9:22 PM, David Winsemius <dwinsemius at comcast.net> wrote:
It is, and a direct accessor is dimnames().
function (x)
x$condlevels
'var.name' is a variable passed to the strip function, and is indeed
not supposed to be accessible from the panel function.

My original intent was to make only the indices available through the
which.packet() accessor function (as it is not clear what else would
be useful for shingles), and the user could pass in the levels as
extra arguments. Note however that by default plot.trellis() saves the
object it is plotting, and it can be accessed from inside the panel
function:

barchart(VADeaths, groups = FALSE,
         panel = function(...) print(dimnames(trellis.last.object())))

The fact that the object is saved _before_ drawing starts is
undocumented, but unlikely to change (and I have no objections to
documenting it).

-Deepayan