internodes {metacoder} | R Documentation |
Get "internode" taxa
Description
Return the "internode" taxa for a [taxonomy()] or [taxmap()] object. An internode is any taxon with a single immediate supertaxon and a single immediate subtaxon. They can be removed from a tree without any loss of information on the relative relationship between remaining taxa. Can also be used to get the internodes of a subset of taxa.
obj$internodes(subset = NULL, value = "taxon_indexes") internodes(obj, subset = NULL, value = "taxon_indexes")
Arguments
obj |
The [taxonomy()] or [taxmap()] object containing taxon information to be queried. |
subset |
Taxon IDs, TRUE/FALSE vector, or taxon indexes used to subset the tree prior to determining internodes. Default: All taxa in 'obj' will be used. Any variable name that appears in [all_names()] can be used as if it was a vector on its own. Note that internodes are determined after the filtering, so a given taxon might be a internode on the unfiltered tree, but not a internode on the filtered tree. |
value |
What data to return. This is usually the name of column in a table in 'obj$data'. Any result of [all_names()] can be used, but it usually only makes sense to use data that corresponds to taxa 1:1, such as [taxon_ranks()]. By default, taxon indexes are returned. |
Value
'character'
See Also
Other taxonomy indexing functions:
branches()
,
leaves()
,
roots()
,
stems()
,
subtaxa()
,
supertaxa()
Examples
## Not run:
# Return indexes of branch taxa
internodes(ex_taxmap)
# Return indexes for a subset of taxa
internodes(ex_taxmap, subset = 2:17)
internodes(ex_taxmap, subset = n_obs > 1)
# Return something besides taxon indexes
internodes(ex_taxmap, value = "taxon_names")
## End(Not run)