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"
     "raw"

     ### 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
     "externalptr" # raw external pointers for use in C code

     "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)'. 

