emptySparse | R Documentation |
Creates an empty sparse matrix (all values being zeros) with the requested format and dimensions. This is a faster alternative to calling 'Matrix::Matrix(0, ...)'.
emptySparse(nrow = 0L, ncol = 0L, format = "R", dtype = "d")
nrow |
Desired number of rows for the matrix. |
ncol |
Desired number of columns for the matrix. |
format |
Storage format for the matrix. Options are:
|
dtype |
Data type for the matrix. Options are:
|
A sparse matrix of general type, with the specific class determined by 'format' and 'dtype'.
### This is very fast despite the large dimensions,
### as no data is held in the resulting object
library(MatrixExtra)
X <- emptySparse(nrow=2^20, ncol=2^25, format="T")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.