home *** CD-ROM | disk | FTP | other *** search
-
- _O_b_j_e_c_t _C_l_a_s_s_e_s
-
- class(x)
- class(x) <- names
- unclass(x)
- inherits(x, name)
- is.object(x)
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- R possesses a simple generic function mechanism which
- can be used for an object-oriented style of program-
- ming. Method despatch takes place based on the class
- of the first argument to the generic function.
-
- An R ``object'' is a data object which has a class
- attribute. A class attribute is a vector of character
- strings giving the names of the classes which the
- object ``inherits'' from. When a generic function fun
- is applied to an object with class attribute
- c("first","second"), the system searches for a function
- called fun.first and, if it finds it, applied it to the
- object. If no such function is found a function called
- fun.second is tried. If no class name produces a suit-
- able function, the function fun.default is used.
-
- The function class prints the vector of names of
- classes which an object inherits from. Correspond-
- ingly, class<- sets the classes which an object inher-
- its from. unclass returns (a copy of) its argument
- with its class information removed.
-
- is.object returns TRUE if its argument has a class
- attribute and FALSE otherwise. inherits indicates
- whether its first argument inherits from a class with
- name equal to its second argument.
-
- _S_e_e _A_l_s_o:
-
- UseMethod, NextMethod.
-
-