Extract a subset of the taxonomy for a set of ids

extract_taxo(db, taxon_ids, recursive = TRUE)

Arguments

db

a connection to an EcoTaxa database (from db_connect_ecotaxa()).

taxon_ids

internal, numeric ids of the taxa.

recursive

when TRUE, extract the full taxonomy, until the root.

See also

Other taxonomy-related functions: ancestors(), as.taxo(), children(), descendants(), is_leaf(), lineage(), parent(), taxo_id(), taxo_name()

Examples

db <- db_connect_ecotaxa() extract_taxo(db, 84000:84003)
#> id name parent_id #> 1 84000 Carcinus maenas 83439 #> 2 84001 Caridina multidentata 83647 #> 3 84002 Caridina formosae 83647 #> 4 84003 Carpilius maculatus 83438 #> 5 83439 Carcinus 81916 #> 6 83647 Caridina 81911 #> 7 83438 Carpilius 81916 #> 8 81916 Brachyura 78372 #> 9 81911 Caridea 78372 #> 10 78372 Pleocyemata 45043 #> 11 45043 Decapoda 25824 #> 12 25824 Eumalacostraca 16622 #> 13 16622 Malacostraca 12846 #> 14 12846 Crustacea 11517 #> 15 11517 Arthropoda 2367 #> 16 2367 Metazoa 382 #> 17 382 Holozoa 8 #> 18 8 Opisthokonta 2 #> 19 2 Eukaryota 1 #> 20 1 living NA
extract_taxo(db, 84000:84003, recursive=FALSE)
#> id parent_id name id_source creation_datetime #> 1 84000 83439 Carcinus maenas 46613 <NA> #> 2 84001 83647 Caridina multidentata 46616 <NA> #> 3 84002 83647 Caridina formosae 46615 <NA> #> 4 84003 83438 Carpilius maculatus 46621 <NA> #> creator_email display_name id_instance lastupdate_datetime rename_to #> 1 <NA> Carcinus maenas NA 2018-01-02 NA #> 2 <NA> Caridina multidentata NA 2018-01-02 NA #> 3 <NA> Caridina formosae NA 2018-01-02 NA #> 4 <NA> Carpilius maculatus NA 2018-01-02 NA #> source_desc source_url taxostatus taxotype #> 1 <NA> <NA> A P #> 2 <NA> <NA> A P #> 3 <NA> <NA> A P #> 4 <NA> <NA> A P