create_sparse | R Documentation |
Create sparse matrix from triplet of coordinates and value
create_sparse(i, j, x = 1)
i |
A vector of row membership |
j |
A vector of column membership |
x |
A vector of the entries that should go in (i, j) |
A sparse matrix of class dgCMatrix
from the Matrix package
i <- sample(letters, 10, replace = TRUE)
j <- sample(1:100, 10, replace = TRUE)
create_sparse(i, j)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.