The R Project SVN R

Rev

Rev 71366 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 71366 Rev 71548
Line 114... Line 114...
114
 
114
 
115
A class may inherit all the slots and methods of one or more existing
115
A class may inherit all the slots and methods of one or more existing
116
classes by specifying the names of the inherited classes in the \code{contains =} argument to
116
classes by specifying the names of the inherited classes in the \code{contains =} argument to
117
\code{\link{setClass}()}.
117
\code{\link{setClass}()}.
118
 
118
 
119
To define a class that extends the \code{"Pos"} to a class
119
To define a class that extends class \code{"Pos"} to a class
120
\code{"GPS"} with a slot for the observation times:
120
\code{"GPS"} with a slot for the observation times:
121
 
121
 
122
\code{GPS <- setClass("GPS", slots = c(time = "POSIXt"), contains = "Pos")}
122
\code{GPS <- setClass("GPS", slots = c(time = "POSIXt"), contains = "Pos")}
123
 
123
 
124
The inherited classes may be S4 classes, S3
124
The inherited classes may be S4 classes, S3