methods-package {methods} | R Documentation |
Formal Methods and Classes
Description
Formally defined methods and classes for R objects, plus other programming tools, as described in the references.
Details
This package provides the “S4” or “S version 4” approach to methods and classes in a functional language.
For basic use of the techniques, start with Introduction and
follow the links there to the key functions for programming, notably
setClass
and setMethod
.
Some specific topics:
- Classes:
Creating one, see
setClass
; examining definitions, seegetClassDef
and classRepresentation; inheritance and coercing, seeis
andas
- Generic functions:
Basic programming, see
setGeneric
; the class of objects, see genericFunction; other functions to examine or manipulate them, see GenericFunctions.- S3:
Using classes, see
setOldClass
; methods, see Methods_for_S3.- Reference classes:
See ReferenceClasses.
- Class unions; virtual classes
See
setClassUnion
.
These pages will have additional links to related topics.
For a complete
list of functions and classes, use library(help="methods")
.
Author(s)
R Core Team
Maintainer: R Core Team R-core@r-project.org
References
Chambers JM (2016). Extending R, series Chapman & Hall/CRC The R Series. CRC Press. ISBN 9781498775717. (Chapters 9 and 10.)
Chambers JM (2008). Software for Data Analysis: Programming with R. Springer, New York. ISBN 978-0-387-75935-7. http://statweb.stanford.edu/~jmc4/Rbook/. (Chapter 10 has some additional details.)