nMatrix-class | R Documentation |
The nMatrix
class is the virtual “mother” class of all
non-zero pattern (or simply pattern)
matrices in the Matrix package.
Common to all matrix object in the package:
Dim
:Object of class "integer"
- the dimensions
of the matrix - must be an integer vector with exactly two
non-negative values.
Dimnames
:list of length two; each component
containing NULL or a character
vector length
equal the corresponding Dim
element.
signature(from = "matrix", to = "nMatrix")
:
Note that these coercions (must) coerce NA
s to
non-zero, hence conceptually TRUE
.
This is particularly important when
sparseMatrix
objects are coerced to
"nMatrix"
and hence to nsparseMatrix
.
— — —
Additional methods contain group methods, such as
signature(e1 = "nMatrix", e2 = "....")
, ...
signature(e1 = "nMatrix", e2 = "....")
, ...
signature(e1 = "nMatrix", e2 = "....")
, ...
signature(e1 = "nMatrix", e2 = "....")
, ...
signature(x = "nMatrix", "....")
, ...
The classes lMatrix
,
nsparseMatrix
, and the mother class,
Matrix
.
getClass("nMatrix")
L3 <- Matrix(upper.tri(diag(3)))
L3 # an "ltCMatrix"
as(L3, "nMatrix") # -> ntC*
## similar, not using Matrix()
as(upper.tri(diag(3)), "nMatrix")# currently "ngTMatrix"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.