dgCMatrix-class {Matrix}R Documentation

Compressed, sparse, column-oriented numeric matrices

Description

The dgCMatrix class is a class of sparse numeric matrices in the compressed, sparse, column-oriented format. In this implementation the non-zero elements in the columns are sorted into increasing row order.

Objects from the Class

Objects can be created by calls of the form new("dgCMatrix", ...).

Slots

p:
Object of class "integer" of pointers, one for each column, to the initial (zero-based) index of elements in the column.
i:
Object of class "integer" of length nnzero (number of non-zero elements). These are the row numbers for each non-zero element in the matrix.
x:
Object of class "numeric" - the non-zero elements of the matrix.
nrow:
Object of class "integer" - the number of rows in the matrix.

Methods

coerce
signature(from = "matrix", to = "dgCMatrix")
coerce
signature(from = "dgCMatrix", to = "matrix")
coerce
signature(from = "dgCMatrix", to = "dgBCMatrix")
coerce
signature(from = "dgCMatrix", to = "dgTMatrix")
crossprod
signature(x = "dgCMatrix", y = "missing") returns t(x) %*% x as an dsCMatrix object.
crossprod
signature(x = "dgCMatrix", y = "matrix"): ...
crossprod
signature(x = "dgCMatrix", y = "numeric"): ...
diag
signature(x = "dgCMatrix"): returns the diagonal of x
dim
signature(x = "dgCMatrix"): returns the dimensions of x
image
signature(x = "dgCMatrix"): plots an image of x using the levelplot function

See Also

dsCMatrix-class, dtCMatrix-class

Examples

m <- Matrix(1:12, nrow = 3)
(mC <- as(m, "dgCMatrix"))
str(mC)
mC[,1]

[Package Matrix version 0.95-10 Index]