library(rbiom)
biom <- hmp50[1:5]
sample_sums(biom)
# Rarefy to the lowest sample depth
# (All samples are kept, but counts are reduced)
biom_rare <- rarefy(biom, depth = min(sample_sums(biom)))
sample_sums(biom_rare)
# Auto-select depth (may drop samples with low coverage)
biom_auto <- rarefy(biom)
sample_sums(biom_auto)
Run the code above in your browser using DataLab