add_taxon_tibble | R Documentation |
add_taxon_tibble
adds a taxon tibble to the tidyamplicons object.
add_taxon_tibble(ta, taxon_tibble)
ta |
Tidyamplicons object. |
taxon_tibble |
A tibble containing taxon data for each taxon. Taxa should be rows, while taxon data should be columns. At least one column name needs to be shared with the taxon tibble of ta. The default shared column name is 'taxon'. |
This function adds a taxon tibble containing taxon data (e.g. taxon ranks
such as genus, family, ...) for each taxon to the tidyamplicons object. It is
used after initiating a tidyamplicons object using a numerical abundance
matrix and the function create_tidyamplicons
. Also see
add_sample_tibble
to update the sample data of the
tidyamplicons object.
# 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)
# Initiate taxon tibble
taxon <- c("taxon1", "taxon2")
genus <- c("Salmonella", "Lactobacillus")
taxon_tibble <- tibble::tibble(taxon, genus)
# Add taxon tibble to tidyamplicons object
data <- data %>%
add_taxon_tibble(taxon_tibble)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.