This function retrieves the conservation status of species from the iucn_data dataset.
It supports multiple species names and uses data.table for efficient performance.
The output format can be customized to either a vector of conservation statuses or a tibble.
Value
A vector or tibble, depending on the specified format, with species names and their corresponding conservation statuses.
If no match is found for a species, it will return "no match found".
Examples
species <- c("Panthera uncia", "Cedrela odorata")
result <- get_iucn_status(splist = species, format = "tbl")
#>
#> ── Matching names to IUCN genus list ───────────────────────────────────────────
#> ✔ All input genera were matched successfully (2 exact, 0 fuzzy).
#>
#> ── Matching names to IUCN species list ─────────────────────────────────────────
#> ✔ All species were matched successfully (2 exact, 0 fuzzy).
print(result)
#> # A tibble: 2 × 5
#> id submitted_name matched_species redlist_category redlist_criteria
#> <int> <chr> <chr> <chr> <chr>
#> 1 1 Panthera uncia Panthera uncia Vulnerable ---
#> 2 2 Cedrela odorata Cedrela odorata Vulnerable ---