Fuzzy Search for Species Names Using Approximate Matching
Source:R/search_reptiledbr.R
reptiledbr_partial.RdThis function performs approximate (fuzzy) matching of species names from a given list of input terms against the species names in the reptile database, and indicates whether each matched species has subspecies.
Value
A tibble with matched species, taxonomic info, fuzzy match flag, and subspecies presence. The response variable may return different messages depending on the outcome of the query. Possible values include:
"Species not found"– The specified species could not be matched in the database."Species has subspecies"– The specified species exists and has one or more subspecies registered."No subspecies found"– The species was found, but there are no subspecies associated with it in the database.
Examples
reptiledbr_partial(c("Ablepharus alaicuss", "Anolis limom"))
#> # A tibble: 2 × 11
#> id input_name found species_match order family genus epithet author
#> <int> <chr> <lgl> <chr> <fct> <fct> <fct> <fct> <chr>
#> 1 1 Ablepharus alaicu… TRUE Ablepharus a… Saur… Scinc… Able… alaicus Elpat…
#> 2 2 Anolis limom TRUE Anolis limon Saur… Anoli… Anol… limon Velas…
#> # ℹ 2 more variables: fuzzy_match <lgl>, message <chr>