Update method for objects of class
"trellis", and a way to retrieve
the last printed trellis object (that was saved).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
## S3 method for class 'trellis' update(object, panel, aspect, as.table, between, key, auto.key, legend, layout, main, page, par.strip.text, prepanel, scales, skip, strip, strip.left, sub, xlab, ylab, xlab.top, ylab.right, xlim, ylim, xscale.components, yscale.components, axis, par.settings, plot.args, lattice.options, index.cond, perm.cond, ...) ## S3 method for class 'trellis' t(x) ## S3 method for class 'trellis' x[i, j, ..., drop = FALSE] trellis.last.object(..., prefix)
The object to be updated, of class
indices to be used. Names are not currently allowed.
logical, whether dimensions with only one level are to be dropped.
Currently ignored, behaves as if it were
arguments that will be used to update
A character string acting as a prefix identifying the plot of a
All high level lattice functions such as
xyplot produce an
object of (S3) class
"trellis", which is usually displayed by its
update method, and then
re-displayed as needed.
Most arguments to high level functions can also be supplied to the
update method as well, with some exceptions. Generally
speaking, anything that would needs to change the data within each
panel is a no-no (this includes the
formula, data, groups,
subset). Everything else is technically game,
though might not be implemented yet. If you find something missing
that you wish to have, feel free to make a request.
Not all arguments accepted by a Lattice function are processed by
update, but the ones listed above should work. The purpose of
these arguments are described in the help page for
xyplot. Any other argument is added to the list of
arguments to be passed to the
panel function. Because of their
somewhat special nature, updates to objects produced by
wireframe do not work very well yet.
"[" method is a convenient shortcut for updating
t method is a convenient shortcut for
perm.cond in the special (but frequent) case where
there are exactly two conditioning variables, when it has the effect
of switching (‘transposing’) their order.
The print method for
"trellis" objects optionally saves the
object after printing it. If this feature is enabled,
trellis.last.object can retrieve it. By default, the last
object plotted is retrieved, but if multiple objects are plotted on
the current page, then others can be retrieved using the appropriate
prefix argument. If
called with arguments, these are used to update the retrieved object
before returning it.
An object of class
trellis, by default plotted by
NULL is no saved object is available.
Deepayan Sarkar Deepayan.Sarkar@R-project.org
1 2 3 4 5 6 7 8
spots <- by(sunspots, gl(235, 12, labels = 1749:1983), mean) old.options <- lattice.options(save.object = TRUE) xyplot(spots ~ 1749:1983, xlab = "", type = "l", scales = list(x = list(alternating = 2)), main = "Average Yearly Sunspots") update(trellis.last.object(), aspect = "xy") trellis.last.object(xlab = "Year") lattice.options(old.options)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.