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'

