View source: R/old_taxa--taxonomy--s3.R
arrange_taxa | R Documentation |
Sort the edge list and taxon list in [taxonomy()] or [taxmap()] objects. See [dplyr::arrange()] for the inspiration for this function and more information. Calling the function using the 'obj$arrange_taxa(...)' style edits "obj" in place, unlike most R functions. However, calling the function using the ‘arrange_taxa(obj, ...)' imitates R’s traditional copy-on-modify semantics, so "obj" would not be changed; instead a changed version would be returned, like most R functions.
obj$arrange_taxa(...) arrange_taxa(obj, ...)
obj |
[taxonomy()] or [taxmap()] |
... |
One or more expressions (e.g. column names) to sort on. Any variable name that appears in [all_names()] can be used as if it was a vector on its own. |
An object of type [taxonomy()] or [taxmap()]
Other taxmap manipulation functions:
arrange_obs()
,
filter_obs()
,
filter_taxa()
,
mutate_obs()
,
sample_frac_obs()
,
sample_frac_taxa()
,
sample_n_obs()
,
sample_n_taxa()
,
select_obs()
,
transmute_obs()
# Sort taxa in ascending order
arrange_taxa(ex_taxmap, taxon_names)
# Sort taxa in decending order
arrange_taxa(ex_taxmap, desc(taxon_names))
# Sort using an expression. List genera first.
arrange_taxa(ex_taxmap, taxon_ranks != "genus")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.