Calculate the alpha diversity of each sample.
adiv_table(
biom,
adiv = "shannon",
md = ".all",
tree = NULL,
transform = "none",
ties = "random",
seed = 0,
cpus = n_cpus()
)adiv_matrix(
biom,
adiv = c("observed", "shannon", "simpson"),
tree = NULL,
transform = "none",
ties = "random",
seed = 0,
cpus = n_cpus()
)
adiv_vector(
biom,
adiv = "shannon",
tree = NULL,
transform = "none",
ties = "random",
seed = 0,
cpus = n_cpus()
)
adiv_vector() - A named numeric vector.
adiv_matrix() - A matrix of samples x metric. The first column, 'depth', is never transformed.
adiv_table() - A tibble data.frame of alpha diversity values.
Each combination of sample/adiv has its own row.
Column names are .sample, .depth, .adiv,
and .diversity, followed by any metadata fields requested by
md.
An rbiom object, or any value accepted by as_rbiom().
Alpha diversity metric(s) to use. Options are:
c("ace", "berger", "brillouin", "chao1", "faith", "fisher", "simpson", "inv_simpson", "margalef", "mcintosh", "menhinick", "observed", "shannon", "squares").
For "faith", a phylogenetic tree must be present in biom or
explicitly provided via tree=. Set adiv=".all" to use all metrics.
Multiple/abbreviated values allowed. Default: "shannon"
Dataset field(s) to include in the output data frame, or '.all'
to include all metadata fields. Default: '.all'
A phylo object representing the phylogenetic
relationships of the taxa in biom. Only required when
computing UniFrac distances. Default: biom$tree
Transformation to apply to calculated values. Options are:
c("none", "rank", "log", "log1p", "sqrt", "percent"). "rank" is
useful for correcting for non-normally distributions before applying
regression statistics. Default: "none"
When transform="rank", how to rank identical values.
Options are: c("average", "first", "last", "random", "max", "min").
See rank() for details. Default: "random"
Random seed for permutations. Must be a non-negative integer.
Default: 0
The number of CPUs to use. Set to NULL to use all available,
or to 1 to disable parallel processing. Default: NULL
sample_sums() for sample depths.
Other alpha_diversity:
adiv_boxplot(),
adiv_corrplot(),
adiv_stats()
library(rbiom)
biom <- hmp50[1:5]
adiv_table(biom)
biom <- rarefy(biom)
adiv_table(biom, md = NULL)
adiv_vector(biom, 'faith')
adiv_matrix(biom)
Run the code above in your browser using DataLab