Skip to contents

[Experimental]

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.

Usage

get_iucn_status(splist, format = "vect")

Arguments

splist

A character vector containing species names to search for in the iucn_data dataset.

format

A character string specifying the output format. Options are:

  • "vect": Returns a vector of conservation statuses.

  • "tbl": Returns a tibble with species names and conservation statuses. Default is "vect".

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       ---