class                package:methods                R Documentation

_C_l_a_s_s _o_f _a_n _O_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     Returns the name of the object's class as a character string.

     In contrast to the version of this function in the base package,
     this version of `class' never returns `NULL'.  For objects that do
     not have a formal class definition, and do not have the `"class"'
     attribute set, the value returned is effectively the same as
     `data.class'.

     The replacement version of the function sets the class to the
     value provided.  For classes that have a formal definition,
     directly replacing the class this way is strongly deprecated.  The
     expression `as(object, value)' is the way to coerce an object to a
     particular class.

_U_s_a_g_e:

     class(object)

     class(object) <- value

_A_r_g_u_m_e_n_t_s:

  object: Any R object (including basic objects for which no class is
          currently defined).  When assigning the class, however, it
          must be possible to coerce the object to the specified class:
           the semantics of assigning a class to `object' are
          equivalent to `object <- as(object, value)'.  

_A_u_t_h_o_r(_s):

     John Chambers

_R_e_f_e_r_e_n_c_e_s:

     The web page <URL: http://www.omegahat.org/RSMethods/index.html>
     is the primary documentation.

     The functions in this package emulate the facility for classes and
     methods described in Programming with Data (John M. Chambers,
     Springer, 1998).  See this book for further details and examples.

_S_e_e _A_l_s_o:

     `as'

