1 Overview

In this discussion activity, you will work with your small groups to query the IUCN Red List using its application programming interface, or API for short.

The objective of this activity is to better understand the criteria for Red-Listing species based on IUCN species narratives. Table 1 in the Collen paper presents a great overview of the listing criteria.

Note that an organism is listed based on the most severe category of threat. Thus, if any condition meets the criteria for Endangered, that is the status that would apply, even if under other conditions the species is Vulnerable or Near-Threatened (lower threat categories).

2 Code

Please work in groups to execute the following code within the project Listing Species. It should be visible in the Files pane (bottom right-hand side) as IUCNactivity.R.

In case you are having access issues with the link above, here are some other options. Please navigate to either:

  1. The class workspace, Conservation Biology Spring 2023.
  2. Alternatively, please try the SSO log-in page only: sso.rstudio.cloud/pomona
  3. You will click on the ListingSpecies assignment there.

For convenience, I also include the IUCNactivity.R script contents here:

###==================================================
### Loading packages & keys
###==================================================
library("rredlist") # load rredlist package
library("dplyr")    # load package for wrangling data
  # API = application programming interface

###==================================================
### Obtaining data from the IUCN Red List
###==================================================

### Specify your species
species_to_study <- "Pezoporus occidentalis" # change this to your species

### Obtain the species narrative for your organism
IUCN_REDLIST_KEY <- Sys.getenv('IUCN_REDLIST_KEY') # if the key isn't working in line 19,
# IUCN_REDLIST_KEY <- Sys.getenv('IUCN_REDLIST_KEY_2') # then uncomment and run this line
IUCN_data <- rl_narrative(species_to_study, key=IUCN_REDLIST_KEY)

###==================================================
### Viewing your IUCN Red List output
###==================================================

### Creating a cleaner output
IUCN_table <- IUCN_data$result # extract the outputs and store as a "tibble" (tidy table)

### Viewing the overall table
View(IUCN_table)

### Getting the names of the columns
names(IUCN_table)

### Viewing the rationale for your species
IUCN_table %>% 
  dplyr::select(rationale) # selecting the column rationale

### Viewing the geographic range for your species
IUCN_table %>%
  dplyr::select(geographicrange)

### Viewing the population trend for your species
IUCN_table %>%
  dplyr::select(populationtrend)

### Viewing the population summary for your species
IUCN_table %>%
  dplyr::select(...) # what would you type here to select the column population?

### Viewing additional variables
IUCN_table %>%
  dplyr::select(...) # what would you type here to select the column habitat?

### Viewing additional variables
IUCN_table %>%
  dplyr::select(...) # what would you type here to select the column threats, or conservationmeasures, or usetrade?

3 Accessing the class workspace

If you are still having issues accessing the Class workspace, please try the following:

  1. Clear browser cache/cookies and open an incognito window
  2. Open this link in the private/incognito window https://sso.rstudio.cloud/pomona