- show
(object = "sparseMatrix")
: The
show
method for sparse matrices prints
“structural” zeroes as "."
using
printSpMatrix()
which allows further customization.
- print
signature(x = "sparseMatrix")
, ....
The print
method for sparse matrices by default is the
same as show()
but can be called with extra optional
arguments, see printSpMatrix()
.
- format
signature(x = "sparseMatrix")
, ....
The format
method for sparse matrices, see
formatSpMatrix()
for details such as the extra
optional arguments.
- summary
(object = "sparseMatrix", uniqT=FALSE)
: Returns
an object of S3 class "sparseSummary"
which is basically a
data.frame
with columns (i,j,x)
(or just
(i,j)
for nsparseMatrix
class objects)
with the stored (typically non-zero) entries. The
print
method resembles Matlab's way of printing
sparse matrices, and also the MatrixMarket format, see
writeMM
.
- cbind2
(x = *, y = *)
: several methods for binding
matrices together, column-wise, see the basic cbind
and rbind
functions.
Note that the result will typically be sparse, even when one
argument is dense and larger than the sparse one.
- rbind2
(x = *, y = *)
: binding matrices together
row-wise, see cbind2
above.
- determinant
(x = "sparseMatrix", logarithm=TRUE)
:
determinant()
methods for sparse matrices typically
work via Cholesky
or lu
decompositions.
- diag
(x = "sparseMatrix")
: extracts the diagonal of a
sparse matrix.
- dim<-
signature(x = "sparseMatrix", value = "ANY")
:
allows to reshape a sparse matrix to a sparse matrix with
the same entries but different dimensions. value
must be of
length two and fulfill prod(value) == prod(dim(x))
.
- coerce
signature(from = "factor", to = "sparseMatrix")
:
Coercion of a factor to "sparseMatrix"
produces the matrix
of indicator rows stored as an object of class
"dgCMatrix"
. To obtain columns representing the interaction
of the factor and a numeric covariate, replace the "x"
slot
of the result by the numeric covariate then take the transpose.
Missing values (NA
) from the factor are translated
to columns of all 0
s.