摘要:R now has two systems of classes and methods, known informally as the ‘S3’ and ‘S4’ systems. Both systems are based on the assignment of a class to an object and the use of generic functions that invoke different methods according to the class of their arguments. Classes organize the representation of information and methods organize the actions that are applied to these representations. ‘S3’ classes and methods for the S language were introduced in Chambers and Hastie (1992), (see also Venables and Ripley, 2000, ch. 4) and have been implemented in R from its earliest public versions. Because many widely-used R functions, such as print, plot and summary, are S3 generics, anyone using R inevitably (although perhaps unknowingly) uses the S3 system of classes and methods.