grid.record               package:grid               R Documentation

_E_n_c_a_p_s_u_l_a_t_e _c_a_l_c_u_l_a_t_i_o_n_s _a_n_d _d_r_a_w_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     Evaluates an expression that includes both calculatons and drawing
     that depends on the calculations so that both the calculations and
     the drawing will be rerun when the scene is redrawn (e.g., device
     resize or editing).

     Intended _only_ for expert use.

_U_s_a_g_e:

     recordGrob(expr, list, name=NULL, gp=NULL, vp=NULL)
     grid.record(expr, list, name=NULL, gp=NULL, vp=NULL)

_A_r_g_u_m_e_n_t_s:

    expr: object of mode 'expression' or 'call' or an "unevaluated
          expression".

    list: a list defining the environment in which 'expr' is to be
          evaluated.

    name: A character identifier. 

      gp: An object of class 'gpar', typically the output from a call
          to the function 'gpar'.  This is basically a list of
          graphical parameter settings.

      vp: A Grid viewport object (or NULL).

_D_e_t_a_i_l_s:

     A grob is created of special class '"recordedGrob"' (and drawn, in
     the case of 'grid.record'). The 'drawDetails' method for this
     class evaluates the expression with the list as the evaluation
     environment (and the grid Namespace as the parent of that
     environment).

_N_o_t_e:

     This function _must_ be used instead of the function
     'recordGraphics';  all of the dire warnings about using
     'recordGraphics' responsibly also apply here.

_A_u_t_h_o_r(_s):

     Paul Murrell

_S_e_e _A_l_s_o:

     'recordGraphics'

_E_x_a_m_p_l_e_s:

     grid.record({
                   w <- convertWidth(unit(1, "inches"), "npc")
                           grid.rect(width=w)
                 },
                 list())

