classifications: Get classifications of taxa

View source: R/old_taxa--taxonomy--s3.R

classificationsR Documentation

Get classifications of taxa

Description

Get character vector classifications of taxa in an object of type [taxonomy()] or [taxmap()] composed of data associated with taxa. Each classification is constructed by concatenating the data of the given taxon and all of its supertaxa.

obj$classifications(value = "taxon_names", sep = ";")
classifications(obj, value = "taxon_names", sep = ";")

Arguments

obj

([taxonomy()] or [taxmap()])

value

What data to return. Any result of 'all_names(obj)' can be used, but it usually only makes sense to data that corresponds to taxa 1:1, such as [taxon_ranks()]. By default, taxon indexes are returned.

sep

('character' of length 1) The character(s) to place between taxon IDs

Value

'character'

See Also

Other taxonomy data functions: id_classifications(), is_branch(), is_internode(), is_leaf(), is_root(), is_stem(), map_data_(), map_data(), n_leaves_1(), n_leaves(), n_subtaxa_1(), n_subtaxa(), n_supertaxa_1(), n_supertaxa(), taxon_ids(), taxon_indexes(), taxon_names(), taxon_ranks()

Examples

# Defualt settings returns taxon names separated by ;
classifications(ex_taxmap)

# Other values can be returned besides taxon names
classifications(ex_taxmap, value = "taxon_ids")

# The separator can also be changed
classifications(ex_taxmap, value = "taxon_ranks", sep = "||")


metacoder documentation built on April 4, 2023, 9:08 a.m.