Description Usage Arguments Value Author(s) Examples
View source: R/abundant_tax_physeq.R
This function extracts the top n most abundant taxonomic terms at a given level. It uses dplyr to calculate the most abundant elements. Output_format will take "ps" or "tops" and either return the phyloseq object or a character vector of the n most common terms. Ignores NA's by default but can show them (see parameters).
1 2 3 4 5 6 7 8 | abundant_tax_physeq(
physeq = ps,
lvl = "Class",
top = 10,
output_format = "ps",
ignore_na = FALSE,
silent = TRUE
)
|
physeq |
a phyloseq object to rank |
lvl |
a character vector defining the taxonomic level to rank |
top |
an integer n defining the number of returned elements (e.g. 'top=5') |
output_format |
"tops" or "ps" (default), depending on this value, function returns either a character vector or a pruned phyloseq object. |
ignore_na |
TRUE/FALSE, default FALSE. If TRUE, excludes ASVs without assigned taxonomic term in the output. |
silent |
TRUE/FALSE, default TRUE. If FALSE, prints the top n taxonomix terms as a message. |
a phyloseq object or character vector, depending on value of "output_format"
Simeon Rossmann
1 2 | ps_top10genera <- abundant_tax_physeq(physeq = ps, lvl="Genus", top=10)
top5species <- abundant_tax_physeq(physeq = ps, lvl="Species", top=5, output_format="tops", ignore_na = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.