View source: R/utility_functions.R
sparse2df | R Documentation |
Convert sparse matrix to data.frame. Developed to handle large datasets, by constructing data.frame block-by-block.
sparse2df(mat.sparse, block.size = 10000, transpose = F, verbose.error = F)
mat.sparse |
Sparse matrix. |
block.size |
If large dataset, construct data.frame column-wise block-by-block, where block size is specified by numeric block.size parameter. Default is 10000. |
transpose |
Logical specifying whether to transpose data. |
verbose.error |
Logical specifying whether to print error message in case of large dataset which requires block-by-block construction. |
data frame
Nicholas Mikolajewicz
sparse2dense
# Get sparse matrix
exp.mat <- so@assays[[current.assay]]@data
# convert to data.frame
df <- sparse2df(mat.sparse, transpose = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.