BasicClasses             package:methods             R Documentation

_C_l_a_s_s_e_s _C_o_r_r_e_s_p_o_n_d_i_n_g _t_o _B_a_s_i_c _D_a_t_a _T_y_p_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Formal classes exist corresponding to the basic R data types,
     allowing these types to be used in method signatures, as slots in
     class definitions, and to be extended by new classes.

_U_s_a_g_e:

     ### The following are all basic vector classes.
     ### They can appear as class names in method signatures,
     ### in calls to as(), is(), and new().
     "character"
     "complex"
     "double"
     "expression"
     "integer"
     "list"
     "logical"
     "numeric"
     "single"

     ### the class
     "vector"
     ### is a virtual class, extended by all the above

     ### The following are additional basic classes
     "NULL"     #  NULL objects
     "function" #  function objects, including primitives

     "ANY"  # virtual classes used by the methods package itself
     "VIRTUAL"
     "missing"

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s_e_s:

     Objects can be created by calls of the form `new(Class, ...)',
     where `Class' is the quoted class name, and the remaining
     arguments if any are objects to be interpreted as vectors of this
     class.  Multiple arguments will be concatenated.

     The class `"expression"' is slightly odd, in that the ...
     arguments will not be evaluated; therefore, don't enclose them in
     a call to `quote()'.

_E_x_t_e_n_d_s:

     Class `"vector"', directly.

_M_e_t_h_o_d_s:

     _c_o_e_r_c_e Methods are defined to coerce arbitrary objects to these
          classes, by calling the corresponding basic function, for
          example, `as(x, "numeric")' calls `as.numeric(x)'. 

