alpha.div {rbiom} | R Documentation |
Estimate the diversity of each sample.
Description
Estimate the diversity of each sample.
Usage
alpha.div(biom, rarefy = FALSE)
Arguments
biom |
A |
rarefy |
Control how/whether rarefactions are done prior to alpha diversity computations. Options are:
|
Value
A data frame of four diversity values for each sample in
biom
. The column names are Sample, Depth and the
diversity metrics: OTUs, Shannon, Chao1, Simpson,
and InvSimpson. The row names are the sample names, except when
multiple rarefactions are done.
Examples
library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read.biom(infile)
ad <- alpha.div(biom)
head(ad)
biom <- subset(biom, `Body Site` == "Saliva" & Age < 26)
ad <- alpha.div(biom, "multi")
boxplot(Shannon ~ Depth, data=ad, xlab="Reads", ylab="Diversity")