get_taxa: Obtaining taxonomy for a SAFE dataset.

Description Usage Arguments Details Value See Also Examples

View source: R/taxa.R

Description

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.

Usage

1
get_taxa(obj)

Arguments

obj

A single record id, or an existing safedata dataframe.

Details

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:

https://safedata-validator.readthedocs.io/en/latest/data_format/taxa/

Value

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

See Also

add_taxa

Examples

1
2
3
   safedir <- system.file('example_data_dir', package='safedata')
   set_safe_dir(safedir, update=FALSE, validate=FALSE)
   taxa <- get_taxa(1400562)

ImperialCollegeLondon/safe_data documentation built on Jan. 29, 2020, 10:19 p.m.