StructureClasses           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 _S_t_r_u_c_t_u_r_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The virtual class 'structure' and classes that extend it are
     formal classes analogous to S language structures such as arrays
     and time-series.

_U_s_a_g_e:

     ## The following class names can appear in method signatures,
     ## as the class in as() and is() expressions, and, except for
     ## the classes commented as VIRTUAL, in calls to new()

     "matrix"
     "array"
     "ts"

     "structure" ## VIRTUAL

_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 name of the specific class (e.g.,
     '"matrix"'), and the other arguments, if any, are interpreted as
     arguments to the corresponding function, e.g., to function
     'matrix()'.  There is no particular advantage over calling those
     functions directly, unless you are writing software designed to
     work for multiple classes, perhaps with the class name and the
     arguments passed in.

_E_x_t_e_n_d_s:

     The specific classes all extend class '"structure"', directly, and
     class '"vector"', by class '"structure"'.

_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, "matrix")' calls 'as.matrix(x)'.

     _O_p_s, _M_a_t_h Group methods (see, e.g., 'S4groupGeneric') are defined
          for combinations of structures and vectors (including special
          cases for array and matrix), implementing the concept of
          vector structures as in the reference.


_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.

_E_x_a_m_p_l_e_s:

     showClass("structure")

     ## explore a bit :
     showClass("ts")
     (ts0 <- new("ts"))
     str(ts0)

     showMethods("Ops") # six methods from these classes, but maybe many more

