resolve_sci_taxa: Resolve scientific names to an authority

Description Usage Arguments Value Examples

View source: R/resolve_sci_taxa.R

Description

Resolve taxa to preferred authorities and get associated IDs.

Usage

1
resolve_sci_taxa(x = NULL, data.sources, path = NULL)

Arguments

x

(character) A vector of taxa names.

data.sources

(numeric) An ordered vector of authority IDs to be queried ( view_taxa_authorities() lists currently supported authorities). Taxa are resolved to authorities in the order listed. If an authority and ID match cannot be made, then the next will be queried.

path

(character) Path to directory containing taxa_map.csv. This tracks provenance throughout the data cleaning process. Create this file with create_taxa_map().

Value

(data frame; taxa_map.csv) If using x, then a data frame containing the input taxa, accepted taxa name, rank, authority, authority ID, and score are returned. If using path, then an updated version of taxa_map.csv will be returned to path and a data frame of taxa_map.csv to the R environment.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
  # Input a list of taxa

  r <- resolve_sci_taxa(
    x = c("Cupressus macrocarpa", "Oncorhynchus tshawytscha", "Poa pratensis"),
    data.sources = c(3,11))
  r

  # Input taxa_map.csv

  data <- data.table::fread(file = system.file('example_data.txt', package = 'taxonomyCleanr'))
  tm <- create_taxa_map(path = tempdir(), x = data, col = "Species")
  r <- resolve_sci_taxa(data.sources = 3, path = tempdir())
  tm <- read_taxa_map(path = tempdir())

## End(Not run)

EDIorg/taxonomyCleanr documentation built on Oct. 11, 2021, 5:46 a.m.