Please note that the Rdoc syntax/grammar used to convert Rdoc comments in code into Rd files is not strictly defined and is modified by the need of the author. Ideally, there will be a well defined Rdoc language one day.
install.packages("R.oo")
setMethodS3
() function, which is
defined in the R.methodsS3 package (used to be part of
R.oo), is nothing but a conveniency wrapper for setting
up S3 methods, and automatically create an S3 generic
function, if missing. For more information, see the help of
R.methodsS3.
Object
class is a top-level "root" class
that provides support for reference variables.
Any class inheriting from this class supports
reference variables.
Object
class is basically a wrapper around an
environment
, which some additional accessors etc. It is the
environment data type that provides the "emulation" of
reference variables - the Object class structure makes
it easier to extends this class and adds some level of coding
protection. The Object class features is not intended for
referencing individual elements of basic R data types,
but rather for the whole variable of such.
For instance, you can reassign a whole matrix X
part of
the object this way, but you cannot reassign X[1,1]
without creating a completely new copy.
Bengtsson, H. The R.oo package - Object-Oriented Programming with References Using Standard R Code, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), ISSN 1609-395X, Hornik, K.; Leisch, F. & Zeileis, A. (ed.), 2003