View source: R/adders_samples.R
add_alphas | R Documentation |
add_diversity_measures
adds two alpha diversity measures to the
samples tibble of a tidyamplicons object.
add_alphas(ta)
ta |
Tidyamplicons object. |
This function adds two alpha diversity measures (observed and inverse
Simpson) to the samples tibble of a tidyamplicons object under the variable
names observed and inverse_simpson, respectively. This function will also
add relative abundances if not present using add_rel_abundance
.
# Initiate abundance matrix
x <- matrix(
c(1500, 1300, 280, 356),
ncol = 2
)
rownames(x) <- c("taxon1", "taxon2")
colnames(x) <- c("sample1", "sample2")
# Convert to tidyamplicons object
data <- create_tidyamplicons(x,
taxa_are_columns = FALSE
)
# Add total abundance
data <- data %>%
add_diversity_measures()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.