Comprehensive Search for Reptile Species with Exact and Fuzzy Matching
Source:R/search_reptiledbr.R
search_reptiledbr.RdThis function combines both exact and fuzzy matching approaches to search for reptile species names in the database. It first attempts exact matches and then uses fuzzy matching for any species names that weren't found exactly.
Value
A combined tibble with results from both exact and fuzzy matching approaches, with a flag indicating the match type. Results maintain the original order of species_names. 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
search_reptiledbr(c("Ablepharus alaicus", "Anolis limom"))
#> # A tibble: 2 × 12
#> id input_name found species_match order family genus epithet author message
#> <int> <chr> <lgl> <chr> <fct> <fct> <fct> <fct> <chr> <chr>
#> 1 1 Ablepharu… TRUE Ablepharus a… Saur… Scinc… Able… alaicus Elpat… Specie…
#> 2 2 Anolis li… TRUE Anolis limon Saur… Anoli… Anol… limon Velas… No sub…
#> # ℹ 2 more variables: match_type <chr>, fuzzy_match <lgl>