attr                  package:base                  R Documentation

_O_b_j_e_c_t _A_t_t_r_i_b_u_t_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Get or set specific attributes of an object.

_U_s_a_g_e:

     attr(x, which)
     attr(x, which) <- value

_A_r_g_u_m_e_n_t_s:

       x: an object whose attributes are to be accessed.

   which: a character string specifying which attribute is to be
          accessed.

   value: an object, the new value of the attribute.

_V_a_l_u_e:

     This function provides access to a single object attribute.  The
     simple form above returns the value of the named attribute.  The
     assignment form causes the named attribute to take the value on
     the right of the assignment symbol.

     The first form first looks for an exact match to 'code' amongst
     the attributed of 'x', then a partial match.  If no exact match is
     found and more than one partial match is found, the result is
     'NULL'.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'attributes'

_E_x_a_m_p_l_e_s:

     # create a 2 by 5 matrix
     x <- 1:10
     attr(x,"dim") <- c(2, 5)

