update.trellis            package:lattice            R Documentation

_R_e_t_r_i_e_v_e _a_n_d _U_p_d_a_t_e _T_r_e_l_l_i_s _O_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     Update method for objects of class ``trellis'', and a way to
     retrieve the last printed trellis object (that was saved).

_U_s_a_g_e:

     ## S3 method for class 'trellis':
     update(object, ...)
     trellis.last.object()
     trellis.last.object(...)

_A_r_g_u_m_e_n_t_s:

  object: The object to be updated, of class ``trellis''. 

     ...: arguments that will be used to update 'object'. See details
          below.  

_D_e_t_a_i_l_s:

     All the high level lattice functions such as 'xyplot' produce an
     object of (S3) class ``trellis'', which is usually printed by its
     'print' method. However, the object itself can be manipulated and
     modified to a large extent using the 'update' method, and then
     re-plotted 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, subscripts' and
     '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 following should work (they are described in the
     help page for 'xyplot'):

     'panel', 'aspect', 'as.table', 'between', 'key', 'auto.key',
     'legend', 'layout', 'main', 'page', 'par.strip.text', 'prepanel',
     'scales', 'skip', 'strip', 'sub', 'xlab', 'xlim', 'ylab', 'ylim',
     'par.settings', 'index.cond', 'perm.cond'

     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 'cloud' and 'wireframe' do not work
     very well yet.

     The print method for ``trellis'' objects optionally saves the
     object after printing it.  If this feature is on,
     'trellis.last.object' can retrieve it.  Note that at most one
     object can be saved at a time.  If 'trellis.last.object' is called
     with arguments, these are used to update the retrieved object
     before returning it.

_V_a_l_u_e:

     An object of class 'trellis', by default plotted by
     'print.trellis'.

_A_u_t_h_o_r(_s):

     Deepayan Sarkar Deepayan.Sarkar@R-project.org

_S_e_e _A_l_s_o:

     'trellis.object', 'Lattice', 'xyplot'

_E_x_a_m_p_l_e_s:

     spots <- by(sunspots, gl(235, 12, lab = 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")
     ## Not run: 
     trellis.last.object(xlab = "Year")
     ## End(Not run)
     lattice.options(old.options)

