Skip to contents

Create a matrix of samples x alpha diversity metrics.

Usage

adiv_matrix(biom, trans = "none")

Arguments

biom

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

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 numeric matrix with samples as rows and columns named Depth, OTUs, Shannon, Chao1, Simpson, and InvSimpson.

Examples

    library(rbiom)
    
    biom <- slice_head(hmp50, n = 5)
    
    adiv_matrix(biom)
#>       Depth OTUs  Shannon     Chao1   Simpson InvSimpson
#> HMP01  1660   49 1.741153  59.08333 0.5668414   2.308623
#> HMP02  1371   75 2.587403 104.38889 0.8133914   5.358811
#> HMP03  1353   75 2.950982  90.04167 0.8936622   9.403996
#> HMP04  1895   83 3.255785  93.32143 0.9323645  14.785121
#> HMP05  3939   67 1.462651 127.75000 0.5252255   2.106263
#> attr(,"cmd")
#> [1] "adiv_matrix(biom)"