grid.copy                package:grid                R Documentation

_M_a_k_e _a _C_o_p_y _o_f _a _G_r_i_d _G_r_a_p_h_i_c_a_l _O_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     Grid graphical objects are references to list structures, which
     means that copies of graphical objects "point" to the same list
     structure.

     This function copies graphical objects by _value_, which means
     that the copy "points" to a separate list structure.

_U_s_a_g_e:

     grid.copy(grob)

_A_r_g_u_m_e_n_t_s:

    grob: An object of class '"grob"'.

_V_a_l_u_e:

     An object of class '"grob"'.

_A_u_t_h_o_r(_s):

     Paul Murrell

_S_e_e _A_l_s_o:

     'grid.grob'.

_E_x_a_m_p_l_e_s:

     ## Create a graphical object
     l <- grid.lines(draw=FALSE)
     ## View the list.struct
     grid.get(l)
     ## Copy by reference
     l2 <- l
     ## Edit the common list.struct
     grid.edit(l2, gp=gpar(col="green"))
     ## We have modified "l"
     grid.get(l)
     ## Copy by value
     l3 <- grid.copy(l)

