| dMatrix-class {Matrix} | R Documentation |
The dMatrix class is a virtual class contained by all actual
classes of numeric matrices in the Matrix package. Similarly,
all the actual classes of logical matrices inherit from the
lMatrix class.
Common to all matrix object in the package:
Dim:"integer" - the dimensions
of the matrix - must be an integer vector with exactly two
non-negative values.Dimnames:character vector length
equal the corresponding Dim element.
There are (relatively simple) group methods (see, e.g., Arith)
signature(e1 = "dMatrix", e2 = "dMatrix"): ... signature(e1 = "dMatrix", e2 = "numeric"): ... signature(e1 = "numeric", e2 = "dMatrix"): ... signature(x = "dMatrix"): ... signature(x = "dMatrix", digits = "numeric"):
this group contains round() and signif().signature(e1 = "numeric", e2 = "dMatrix"): ... signature(e1 = "dMatrix", e2 = "numeric"): ... signature(e1 = "dMatrix", e2 = "dMatrix"): ... signature(x = "dMatrix"): The "Summary"
group contains the seven functions
max(), min(), range(),
prod(), sum(),
any(), and all().signature(from = "dMatrix", to = "matrix"): ... signature(x = "dMatrix"): computes the
“Matrix Exponential”, see expm.signature(x = "dMatrix"): ... signature(x = "lMatrix"): as the base function
which(x, arr.ind) returns the indices of the
TRUE entries in x; if arr.ind is true,
as a 2-column matrix of row and column indices.
The nonzero-pattern matrix class nMatrix, which
can be used to store non-NA logical
matrices even more compactly.
The numeric matrix classes dgeMatrix,
dgCMatrix, and Matrix.
showClass("dMatrix")
set.seed(101)
round(Matrix(rnorm(28), 4,7), 2)
(M <- zapsmall(Matrix(rlnorm(56, sd=10), 4,14)))
table(as.logical(M == 0))