The preferred mechanism for object–oriented programming in R is described in Chambers (1998). The actual implementation is slightly different (in some parts influenced by Dylan, (Shalit, 1996)). This document provides a short introduction to programming using these classes and methods. It is worth noting that R also supports an older class system (as described in Chambers and Hastie (1992) but we recommend developing all new programs using the new system and will not refer to the older system further. The object system is class–based with multiple inheritance and generic functions that can dispatch on any set of arguments ( signature). In some sense the concepts of classes and methods are distinct and we will deal with them separately. The final section of this document will deal with documenting classes and methods. Classes A class is defined using setClass. setClass(Class, representation, prototype
To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.