Skip to contents

Make taxonomy lookups

Usage

make_gbif_taxonomy(
  df,
  taxa_col = "original_name",
  taxonomy_file,
  target_rank = "species",
  limit = TRUE,
  fixes = NULL,
  overrides = NULL,
  ...
)

Arguments

df

Dataframe with taxa_col.

taxa_col

Character. Name of column in df with taxa names

taxonomy_file

Character. Path to results from envClean::get_taxonomy()

target_rank

Character. Default is 'species'. At what level of the taxonomic hierarchy are results desired. This is the most detailed taxonomy returned. i.e. if genus is the target_rank, no taxa below genus are returned. See envClean::lurank rank column.

limit

Logical. If true (default), the output taxonomy will be limited to the input names in df. Otherwise, all taxa found in taxonomy_file will be returned.

fixes

Data frame with columns resolved_to and prefer. Any taxa result in lutaxa that matches a name in resolved_to will be changed to prefer. Mainly used where legitimate names are used in areas where they do not exist. e.g. Eastern osprey Pandion cristatus does not occur in South Australia but records of this species in South Australia are assumed to be legitimate Osprey (Pandion haliaetus) records.

overrides

Data frame with columns original and prefer. Any original_name result in lutaxa that matches a name in original will be have its corresponding taxa changed to prefer. Useful where GBIF Backbone Taxonomy provides a spurious result. e.g. The GBIF Backbone Taxonomy changes Thinornis rubricollis to Phalaropus lobatus rather than the preferred Charadrius cucullatus.

...

Passed to envClean::get_taxonomy()

Value

named list with elements:

lutaxa

Dataframe. For each unique name in taxa_col, the best taxa to use (taking into account target_rank)

taxonomy

Dataframe. For each taxa in lutaxa a row of taxonomic hierarchy and matching gbif usageKeys