| 19087 |
jmc |
1 |
\name{StructureClasses}
|
|
|
2 |
\docType{class}
|
|
|
3 |
\alias{structure-class}
|
|
|
4 |
\alias{matrix-class}
|
|
|
5 |
\alias{array-class}
|
|
|
6 |
\alias{ts-class}
|
|
|
7 |
\title{Classes Corresponding to Basic Structures }
|
|
|
8 |
\description{ The virtual class \code{structure} and classes that
|
|
|
9 |
extend it are formal classes analogous to S language structures such
|
|
|
10 |
as arrays and time-series}
|
|
|
11 |
\usage{
|
|
|
12 |
## The folowing class names can appear in method signatures,
|
|
|
13 |
## as the class in as() and is() expressions, and, except for
|
|
|
14 |
## the classes commented as VIRTUAL, in calls to new()
|
|
|
15 |
|
|
|
16 |
"matrix"
|
|
|
17 |
"array"
|
|
|
18 |
"ts"
|
|
|
19 |
|
|
|
20 |
"structure" ## VIRTUAL
|
|
|
21 |
}
|
|
|
22 |
\section{Objects from the Classes}{
|
| 23531 |
hornik |
23 |
Objects can be created by calls of the form \code{new(Class, ...)},
|
|
|
24 |
where \code{Class} is the quoted name of the specific class (e.g.,
|
|
|
25 |
\code{"matrix"}), and the other arguments, if any, are interpreted as
|
|
|
26 |
arguments to the corresponding function, e.g., to function
|
|
|
27 |
\code{matrix()}. There is no particular advantage over calling those
|
|
|
28 |
functions directly, unless you are writing software designed to work
|
|
|
29 |
for multiple classes, perhaps with the class name and the arguments
|
|
|
30 |
passed in.
|
| 19087 |
jmc |
31 |
}
|
|
|
32 |
\section{Extends}{
|
| 23531 |
hornik |
33 |
The specific classes all extend class \code{"structure"}, directly, and
|
|
|
34 |
class \code{"vector"}, by class \code{"structure"}.
|
| 19087 |
jmc |
35 |
}
|
|
|
36 |
\section{Methods}{
|
|
|
37 |
\describe{
|
|
|
38 |
\item{coerce}{Methods are defined to coerce arbitrary objects to
|
|
|
39 |
these classes, by calling the corresponding basic function, for
|
|
|
40 |
example, \code{as(x, "matrix")} calls \code{as.matrix(x)}. }
|
|
|
41 |
}
|
|
|
42 |
}
|
|
|
43 |
\keyword{classes}
|