simulate_sparse_matrix | R Documentation |
Generate a simulated sparse matrix for single-cell data testing
simulate_sparse_matrix(
nrow,
ncol,
density = 0.1,
distribution_fun = function(n) stats::rpois(n, lambda = 0.5) + 1,
seed = 1
)
nrow |
Number of rows (genes) in the matrix. |
ncol |
Number of columns (cells) in the matrix. |
density |
Density of non-zero elements (default: 0.1, representing 90 sparsity). |
distribution_fun |
Function to generate non-zero values. |
seed |
Random seed for reproducibility. |
A sparse matrix of class "dgCMatrix"
simulate_sparse_matrix(2000, 500) |>
check_sparsity()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.