get_taxa: Obtaining taxonomy for a SAFE dataset.

View source: R/taxa.R

get_taxaR Documentation

Obtaining taxonomy for a SAFE dataset.


This function generates a taxonomy table for a specified SAFE dataset record. Each row represent a taxon used in the data worksheets in the dataset and the table fields show the taxonomic hierarchy, taken from GBIF, for those taxa.





A single record id, or an existing safedata dataframe.


All SAFE datasets containing taxa must include a Taxa worksheet, which must contain all of the taxa referred to in taxon fields in data worksheets. All entries in this worksheet are validated against the GBIF database before publication and are used to populate the taxonomic index for the SAFE datasets. The validated taxonomic hierarchy for the data is also available in the metadata for a record and this function converts the metadata into a taxonomy table. If the Taxa worksheet for a SAFE project dataset is empty, because the data does not contain observations on taxa, get_taxa will return NULL.

The taxonomy table includes the eight "backbone" taxonomic ranks used in the GBIF database: Kingdom, Phylum, Class, Order, Family, Genus, Species and Subspecies. It also includes three further fields: taxon_name, taxon_rank and gbif_status. These record the original taxa provided in the Taxa worksheet and show where the taxonomic name used in a dataset differs from the canonical name used in GBIF. The row names of the taxon table are the labels used in data worksheets and are used to match a taxonomy table to a loaded data worksheet (see add_taxa).

For more details on the structure of the Taxa worksheet see:


A taxonomy table of classes "safe_taxa" and "data.frame".

See Also



   taxa <- get_taxa(1400562)

safedata documentation built on April 25, 2022, 5:05 p.m.