View source: R/adders_abundances.R
add_rel_abundance | R Documentation |
add_rel_abundance
adds relative abundance to the abundance table of a
tidyamplicons object.
add_rel_abundance(ta)
ta |
Tidyamplicons object. |
This function adds the relative abundance per sample to the abundance table of a tidyamplicons object under the variable name "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 relative abundance
data <- data %>%
add_rel_abundance()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.