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

Examples

# Defualt settings returns taxon names separated by ; classifications(ex_taxmap)
#> b #> "Mammalia" #> c #> "Plantae" #> d #> "Mammalia;Felidae" #> e #> "Mammalia;Notoryctidae" #> f #> "Mammalia;Hominidae" #> g #> "Plantae;Solanaceae" #> h #> "Mammalia;Felidae;Panthera" #> i #> "Mammalia;Felidae;Felis" #> j #> "Mammalia;Notoryctidae;Notoryctes" #> k #> "Mammalia;Hominidae;homo" #> l #> "Plantae;Solanaceae;Solanum" #> m #> "Mammalia;Felidae;Panthera;tigris" #> n #> "Mammalia;Felidae;Felis;catus" #> o #> "Mammalia;Notoryctidae;Notoryctes;typhlops" #> p #> "Mammalia;Hominidae;homo;sapiens" #> q #> "Plantae;Solanaceae;Solanum;lycopersicum" #> r #> "Plantae;Solanaceae;Solanum;tuberosum"
# Other values can be returned besides taxon names classifications(ex_taxmap, value = "taxon_ids")
#> b c d e f g h i #> "b" "c" "b;d" "b;e" "b;f" "c;g" "b;d;h" "b;d;i" #> j k l m n o p q #> "b;e;j" "b;f;k" "c;g;l" "b;d;h;m" "b;d;i;n" "b;e;j;o" "b;f;k;p" "c;g;l;q" #> r #> "c;g;l;r"
# The separator can also be changed classifications(ex_taxmap, value = "taxon_ranks", sep = "||")
#> b c #> "class" "kingdom" #> d e #> "class||family" "class||family" #> f g #> "class||family" "kingdom||family" #> h i #> "class||family||genus" "class||family||genus" #> j k #> "class||family||genus" "class||family||genus" #> l m #> "kingdom||family||genus" "class||family||genus||species" #> n o #> "class||family||genus||species" "class||family||genus||species" #> p q #> "class||family||genus||species" "kingdom||family||genus||species" #> r #> "kingdom||family||genus||species"