| as_matrix | R Documentation |
Convert matrix into dense/sparse matrix
as_matrix(x, return_sparse = FALSE)
x |
A matrix. |
return_sparse |
Whether to output a sparse matrix.
Default is |
A dense or sparse matrix.
m <- simulate_sparse_matrix(
1000, 1000,
decimal = 3
)
a <- as_matrix(m)
a[1:5, 1:5]
b <- as_matrix(m, return_sparse = TRUE)
b[1:5, 1:5]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.