powered by
Constructs a sparse matrix, real or complex.
SparseMatrix(i, j, Mij, nrows, ncols)# S3 method for SparseMatrix print(x, ...)asSparseMatrix(M)
# S3 method for SparseMatrix print(x, ...)
asSparseMatrix(M)
indices of the non-zero coefficients
values of the non-zero coefficients; must be a vector of the same length as i and j or a single number which will be recycled
i
j
dimensions of the matrix
a SparseMatrix object
SparseMatrix
ignored
a matrix, real or complex
A list with the class SparseMatrix.
# NOT RUN { set.seed(666) ( M <- matrix(rpois(50L, 1), 10L, 5L) ) asSparseMatrix(M) # }
Run the code above in your browser using DataLab