| dgTMatrix-class {Matrix} | R Documentation |
The "dgTMatrix" class is the class of sparse
matrices stored as (possibly redundant) triplets.
Objects can be created by calls of the form new("dgTMatrix", ...).
i:"integer" - the row indices
of non-zero entries.j:"integer" - the column
indices of non-zero entries. Must be the same length as slot i.x:"numeric" - the (non-zero)
entry at position (i,j). Must be the same length as slot
i. If an index pair occurs more than once the corresponding
values of slot x are added to form the element of the matrix.Dim:"integer" of length 2 -
the dimensions of the matrix.signature(e1 = "dgTMatrix", e2 = "dgTMatrix")signature(from = "dgTMatrix", to = "dgCMatrix")signature(from = "dgTMatrix", to = "dgeMatrix")signature(from = "dgTMatrix", to = "matrix")signature(from = "dgTMatrix", to = "dsCMatrix")signature(from = "matrix", to = "dsTMatrix")signature(x = "dgTMatrix", y = "missing")
returns t(x) %*% x as an dsCMatrix object.signature(x = "dgTMatrix", y = "matrix"): ... signature(x = "dgTMatrix", y = "numeric"): ... signature(x = "dgTMatrix"): plots an image of
x using the levelplot functionsignature(x = "dgTMatrix"): returns the transpose of
x
Triplet matrices are a convenient form in which to construct sparse
matrices after which they can be coerced to dgCMatrix objects.
m <- Matrix(1:28, nrow = 4) ##FIXME: m[c()...] <- 0 (mT <- as(m, "dgTMatrix")) mT[1,] mT[4, drop = FALSE]