38 |
\code{"matrix"}, or typically, inheriting from the |
\code{"matrix"}, or typically, inheriting from the |
39 |
\code{\linkS4class{Matrix}} class.} |
\code{\linkS4class{Matrix}} class.} |
40 |
} |
} |
|
% \section{Methods}{ |
|
|
% \describe{ |
|
|
|
|
|
% \item{x = "Matrix"}{ ~~describe this method here } |
|
|
% }} |
|
41 |
\details{ |
\details{ |
42 |
These are generic functions with several methods for different matrix |
These are generic functions with several methods for different matrix |
43 |
classes, use e.g., \code{\link{showMethods}(symmpart)} to see them. |
classes, use e.g., \code{\link{showMethods}(symmpart)} to see them. |
44 |
|
|
45 |
|
If the row and column names differ, the result will use the column |
46 |
|
names unless they are (partly) \code{NULL} where the row names are |
47 |
|
non-\code{NULL} (see also the examples). |
48 |
} |
} |
49 |
\value{ |
\value{ |
50 |
\code{symmpart()} returns a symmetric matrix, inheriting from |
\code{symmpart()} returns a symmetric matrix, inheriting from |
55 |
typically of the same class as \code{x} (or the closest |
typically of the same class as \code{x} (or the closest |
56 |
\dQuote{general} one, see \code{\linkS4class{generalMatrix}}). |
\dQuote{general} one, see \code{\linkS4class{generalMatrix}}). |
57 |
} |
} |
58 |
%\references{ ~put references to the literature/web site here ~ } |
\seealso{ |
59 |
%\seealso{ ~~objects to See Also as \code{\link{help}}, ~~~ } |
\code{\link{isSymmetric}}.} |
60 |
\examples{ |
\examples{ |
61 |
m <- Matrix(1:4, 2,2) |
m <- Matrix(1:4, 2,2) |
62 |
symmpart(m) |
symmpart(m) |
64 |
|
|
65 |
stopifnot(all(m == symmpart(m) + skewpart(m))) |
stopifnot(all(m == symmpart(m) + skewpart(m))) |
66 |
|
|
67 |
|
dn <- dimnames(m) <- list(row = c("r1", "r2"), col = c("var.1", "var.2")) |
68 |
|
stopifnot(all(m == symmpart(m) + skewpart(m))) |
69 |
|
colnames(m) <- NULL |
70 |
|
stopifnot(all(m == symmpart(m) + skewpart(m))) |
71 |
|
dimnames(m) <- unname(dn) |
72 |
|
stopifnot(all(m == symmpart(m) + skewpart(m))) |
73 |
|
|
74 |
|
|
75 |
## investigate the current methods: |
## investigate the current methods: |
76 |
showMethods(skewpart, include = TRUE) |
showMethods(skewpart, include = TRUE) |
77 |
} |
} |