adiv_table: Calculate the alpha diversity of each sample.

adiv_tableR Documentation

Calculate the alpha diversity of each sample.

Description

Calculate the alpha diversity of each sample.

Usage

adiv_table(biom, adiv = "Shannon", md = ".all", trans = "none")

Arguments

biom

An rbiom object, such as from as_rbiom(). Any value accepted by as_rbiom() can also be given here.

adiv

Alpha diversity metric(s) to use. Options are: "OTUs", "Shannon", "Chao1", "Simpson", and/or "InvSimpson". Set adiv=".all" to use all metrics. Default: "Shannon"

Multiple/abbreviated values allowed.

md

Dataset field(s) to include in the output data frame, or '.all' to include all metadata fields. Default: '.all'

trans

Transformation to apply. Options are: c("none", "rank", "log", "log1p", "sqrt"). "rank" is useful for correcting for non-normally distributions before applying regression statistics. Default: "none"

Value

A data frame of alpha diversity values.
Each combination of sample/depth/adiv has its own row.
Column names are .sample, .depth, .adiv, and .diversity, followed by any metadata fields requested by md.

See Also

Other alpha_diversity: adiv_boxplot(), adiv_corrplot(), adiv_stats()

Examples

    library(rbiom) 
    
    # Subset to 10 samples.
    biom <- slice(hmp50, 1:10)
    adiv_table(biom)
    
    biom <- rarefy(biom)
    adiv_table(biom, adiv = ".all", md = NULL)

cmmr/rbiom documentation built on April 28, 2024, 6:38 a.m.