Skip to contents

This function queries the IUCN Red List API for the conservation status of a given species (genus and epithet). It handles errors gracefully, logs issues, and returns a data frame with the status and any error messages.

Usage

rfs_iucn_check(species, iucn_api_key, log_path = "iucn_log/")

Arguments

species

Character. The full species name in the format "Genus epithet" (e.g., "Pterophyllum scalare"). Multiple species can be checked by providing a vector of species names.

iucn_api_key

Character. Your IUCN API key.

log_path

Character. The path to the directory where error logs will be saved. Default is "iucn_log/".

Value

A data frame with columns:

species

The full species name.

red_list_status

The IUCN Red List status or error message.

error

Any error message encountered during the query.

possible_solution

Suggested solution if an error occurred.

Examples

if (FALSE) { # \dontrun{
rfs_iucn_check("Pterophyllum scalare", "your_api_key")
} # }