| Line 102... |
Line 102... |
| 102 |
}
|
102 |
}
|
| 103 |
\section{Methods}{
|
103 |
\section{Methods}{
|
| 104 |
\describe{
|
104 |
\describe{
|
| 105 |
\item{coerce}{Methods are defined to coerce arbitrary objects to
|
105 |
\item{coerce}{Methods are defined to coerce arbitrary objects to
|
| 106 |
these classes, by calling the corresponding basic function, for
|
106 |
these classes, by calling the corresponding basic function, for
|
| 107 |
example, \code{as(x, "matrix")} calls \code{as.matrix(x)}.}
|
107 |
example, \code{as(x, "matrix")} calls \code{as.matrix(x)}.
|
| - |
|
108 |
If \code{strict = TRUE} in the call to \code{as()}, the method
|
| - |
|
109 |
goes on to delete all other slots and attributes other than the
|
| - |
|
110 |
\code{dim} and \code{dimnames}.
|
| - |
|
111 |
}
|
| 108 |
\item{Ops}{Group methods (see, e.g., \code{\link{S4groupGeneric}})
|
112 |
\item{Ops}{Group methods (see, e.g., \code{\link{S4groupGeneric}})
|
| 109 |
are defined for combinations of structures and vectors (including
|
113 |
are defined for combinations of structures and vectors (including
|
| 110 |
special cases for array and matrix), implementing the concept of
|
114 |
special cases for array and matrix), implementing the concept of
|
| 111 |
vector structures as in the reference. Essentially, structures
|
115 |
vector structures as in the reference. Essentially, structures
|
| 112 |
combined with vectors retain the structure as long as the
|
116 |
combined with vectors retain the structure as long as the
|
| Line 119... |
Line 123... |
| 119 |
containing a class that inherits from any of the structure
|
123 |
containing a class that inherits from any of the structure
|
| 120 |
classes or class \code{"vector"}.
|
124 |
classes or class \code{"vector"}.
|
| 121 |
}
|
125 |
}
|
| 122 |
}
|
126 |
}
|
| 123 |
}
|
127 |
}
|
| - |
|
128 |
\seealso{Class \linkS4class{nonStructure}, which enforces the
|
| - |
|
129 |
alternative model, in which all slots are dropped if any math
|
| - |
|
130 |
transformation or operation is applied to an object from a class extending one of
|
| - |
|
131 |
the basic classes.
|
| - |
|
132 |
}
|
| 124 |
\references{
|
133 |
\references{
|
| 125 |
Chambers, John M. (2008)
|
134 |
Chambers, John M. (2008)
|
| 126 |
\emph{Software for Data Analysis: Programming with R}
|
135 |
\emph{Software for Data Analysis: Programming with R}
|
| 127 |
Springer. (For the R version.)
|
136 |
Springer. (For the R version.)
|
| 128 |
|
137 |
|