representation {methods} | R Documentation |
Constructs a description of a class (without verifying the validity of
the description). A convenience function in calls to
setClass
.
representation(...)
... |
The call to representation takes arguments that are single character strings. Unnamed arguments are classes that a newly defined class extends; named arguments name the explicit slots in the new class, and specify what class each slot should have. |
The representation
function applies tests for the validity of
the arguments. Each must specify the name of a class.
The classes named don't have to exist when representation
is
called, but if they do, then the function will check for any duplicate
slot names introduced by each of the inherited classes.
The value is just the list of arguments, after these have been checked for validity.
John Chambers
The web page http://www.omegahat.org/RSMethods/index.html is the primary documentation.
The functions in this package emulate the facility for classes and methods described in Programming with Data (John M. Chambers, Springer, 1998). See this book for further details and examples.
setClass
## representation for a new class with a directly define slot "smooth"
## which should be a "numeric" object, and extending class "track"
representation("track", smooth ="numeric")