SparseMatrix | R Documentation |
Constructs a sparse matrix, real or complex.
SparseMatrix(i, j, Mij, nrows, ncols) ## S3 method for class 'SparseMatrix' print(x, ...) asSparseMatrix(M)
i, j |
indices of the non-zero coefficients |
Mij |
values of the non-zero coefficients; must be a vector of the same
length as |
nrows, ncols |
dimensions of the matrix |
x |
a |
... |
ignored |
M |
a matrix, real or complex |
A list with the class SparseMatrix
.
set.seed(666) ( M <- matrix(rpois(50L, 1), 10L, 5L) ) asSparseMatrix(M)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.