
Correct and match taxonomic names to the World Flora Online database
Source:R/correctTaxo.R
correctTaxo.RdMatch taxonomic names using the World Flora Online database, via their GraphQL API
Usage
correctTaxo(
genus,
species = NULL,
interactive = TRUE,
preferAccepted = FALSE,
preferFuzzy = FALSE,
sub_pattern = subPattern(),
useCache = FALSE,
useAPI = TRUE,
capacity = 60,
fill_time_s = 60,
timeout = 10
)Arguments
- genus
vector of genera. Alternatively, the whole taxonomic name (genus + species)
- species
optional, vector of species epithets to be checked (same length as
genus)- interactive
logical, if TRUE (default) user will be prompted to pick names from a list where multiple ambiguous matches are found, otherwise names with multiple ambiguous matches will be skipped
- preferAccepted
logical, if TRUE, if multiple ambiguous matches are found, and if only one candidate is an "accepted" name, automatically choose that name
- preferFuzzy
logical, if TRUE, if multiple ambiguous matches are found, the accepted matched name with the lowest Levenshtein distance to the submitted name will be returned
- sub_pattern
character vector of regex patterns which will be removed from
paste(genus, species)usinggsub(). The order of this vector matters, substitutions are applied sequentially. Sensible defaults are provided bysubPattern()- useCache
logical, if TRUE use cached values in
the$wfo_cachepreferentially, to reduce the number of API calls- useAPI
logical, if TRUE (default) allow API calls
- capacity
maximum number of API calls which can accumulate over the duration of
fill_time_s. See documentation forhttr2::req_throttle()- fill_time_s
time in seconds to refill the capacity for repeated API calls. See documentation for
httr2::req_throttle()- timeout
time in seconds to wait before disconnecting from an unresponsive request
Value
data.frame of taxonomic names with rows matching genus + species.
- nameOriginal
Original name as in
genus+species- nameSubmitted
Name after optional sanitisation according to
sub_pattern- nameMatched
Matched taxonomic name
- nameAccepted
Accepted taxonomic name
- familyAccepted
Family of accepted name
- genusAccepted
Genus of accepted name
- speciesAccepted
Species epithet of accepted name
- nameModified
Flag indicating if
matchedNameis different fromnameOriginal, not including the removal of excess whitespace