Skip to contents

First of all you will need your own API key, an alphanumeric string provided by IUCN that you need to send in every request; the following function takes you to their website, where you will need to fill up a form (it might take 1-2 days to receive your key) rl_use_iucn() Once you receive an email with your API key, set it up as an environmental variable (it MUST be named IUCN_REDLIST_KEY) you will need to re-do this step everytime you restart R Sys.setenv(IUCN_REDLIST_KEY = "") OR add IUCN_REDLIST_KEY = "" to your .Renviron file to permanently set it Sys.getenv("IUCN_REDLIST_KEY") #' check Not Evaluated DD: Data Deficient LC: Least Concern NT: Near Threatened VU: Vulnerable EN: Endangered CR: Critically Endangered EW: Extinct in the Wild EX: Extinct LRlc: Low risk – least concern LRnt: Low risk – near threatened LRcd: Low risk - conservation dependent Categories we care about cate <- c("EX","EW","CR","EN","VU")

Usage

splnr_get_IUCNRedList(df, species_col = "Species")

Arguments

df

The dataframe containing the species to be matched with the IUCN redlist

species_col

A string name for the column containting the species name

Value

A dataframe with an additional column IUCN_Category

Examples

if (FALSE) { # \dontrun{
df <- data.frame(Species = c("Diomedea exulans", "Hippocampus kuda", "Squatina squatina")) %>%
  splnr_get_IUCNRedList()
} # }