An example makes things clearer. The class mechanism offers the user the facility of designing and writing generic functions for special purposes. Among the other generic functions are plot() for displaying objects graphically, summary() for summarising analyses of various types, and anova() for comparing statistical models.
The number of generic functions that can treat a class in a specific way
can be quite large. For example, the functions that can accommodate in
some fashion objects of class data.frame include
A currently complete list can be got by using the methods() function:
methods(class="data.frame")
Conversely the number of classes a generic function can handle can also be
quite large. For example the plot() function has variants for
classes of object
and perhaps more. A complete list can be got again by using the
methods() function:
methods(plot)
The reader is referred to the official references for a complete discussion of this mechanism.
height 3ex depth 1ex width 0em =1.25truein