rarefy | R Documentation |
This function will randomly subsample counts from rows of the input matrix such that the colSums all have even depth.
rarefy(x, depth)
x |
numeric matrix or data.frame that can be converted to a numeric matrix. Samples in columns features in rows. |
depth |
desired sampling depth applied to each library. |
set.seed(123)
m <- matrix(
sample.int(100),
nrow = 10,
dimnames = list(
Gene = paste0("gene.", 1:10),
Sample = paste0("sample.", 1:10)
)
)
colSums(m)
rarefied <- rarefy(m, depth = 100)
colSums(rarefied)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.