library(rbiom)
# rarefy_cols --------------------------------------
biom <- hmp50$clone()
sample_sums(biom) %>% head(10)
biom$counts %<>% rarefy_cols(depth=1000)
sample_sums(biom) %>% head(10)
# rescaling ----------------------------------------
mtx <- matrix(sample(1:20), nrow=4)
mtx
rowSums(mtx)
rowSums(rescale_rows(mtx))
colSums(mtx)
colSums(rescale_cols(mtx))
Run the code above in your browser using DataLab