Learn R Programming

rbiom (version 2.1.2)

adiv_matrix: Create a matrix of samples x alpha diversity metrics.

Description

Create a matrix of samples x alpha diversity metrics.

Usage

adiv_matrix(biom, adiv = ".all", transform = "none", cpus = NULL)

Value

A numeric matrix with samples as rows. The first column is Depth. Remaining columns are the alpha diversity metric names given by adiv: one or more of OTUs, Shannon, Chao1, Simpson, and InvSimpson.

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. Multiple/abbreviated values allowed. Default: ".all"

transform

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

cpus

The number of CPUs to use. Set to NULL to use all available, or to 1 to disable parallel processing. Default: NULL

Examples

Run this code
    library(rbiom)
    
    biom <- slice_head(hmp50, n = 5)
    
    adiv_matrix(biom)

Run the code above in your browser using DataLab