| Line 152... |
Line 152... |
| 152 |
}
|
152 |
}
|
| 153 |
}
|
153 |
}
|
| 154 |
\section{Virtual classes; Basic classes}{
|
154 |
\section{Virtual classes; Basic classes}{
|
| 155 |
|
155 |
|
| 156 |
Classes exist for which no actual objects can be created by a
|
156 |
Classes exist for which no actual objects can be created by a
|
| 157 |
call to \code{\link{new}}, the
|
- |
|
| 158 |
\emph{virtual} classes, in fact a
|
157 |
call to \code{\link{new}}, the \emph{virtual} classes, in fact a
|
| 159 |
very important programming tool. They are used to group together
|
158 |
very important programming tool. They are used to group together
|
| 160 |
ordinary classes that want to share some programming behavior,
|
159 |
ordinary classes that want to share some programming behavior,
|
| 161 |
without necessarily restricting how the behavior is implemented.
|
160 |
without necessarily restricting how the behavior is implemented.
|
| 162 |
Virtual class definitions may if you want include
|
161 |
Virtual class definitions may if you want include
|
| 163 |
slots (to provide some common behavior without fully defining
|
162 |
slots (to provide some common behavior without fully defining
|
| Line 169... |
Line 168... |
| 169 |
more of subclasses (classes that extend the class union). Class
|
168 |
more of subclasses (classes that extend the class union). Class
|
| 170 |
unions can include as subclasses basic object types (whose
|
169 |
unions can include as subclasses basic object types (whose
|
| 171 |
definition is otherwise sealed).
|
170 |
definition is otherwise sealed).
|
| 172 |
|
171 |
|
| 173 |
There are a number of \sQuote{basic} classes, corresponding to the
|
172 |
There are a number of \sQuote{basic} classes, corresponding to the
|
| 174 |
ordinary kinds of data occurring in R. For example,
|
173 |
ordinary kinds of data occurring in \R. For example,
|
| 175 |
\code{"numeric"} is a class corresponding to numeric vectors.
|
174 |
\code{"numeric"} is a class corresponding to numeric vectors.
|
| 176 |
The other vector basic classes are \code{"logical"}, \code{"integer"},
|
175 |
The other vector basic classes are \code{"logical"}, \code{"integer"},
|
| 177 |
\code{"complex"}, \code{"character"}, \code{"raw"}, \code{"list"}
|
176 |
\code{"complex"}, \code{"character"}, \code{"raw"}, \code{"list"}
|
| 178 |
and \code{"expression"}.
|
177 |
and \code{"expression"}.
|
| 179 |
The prototypes for
|
178 |
The prototypes for
|