RL_fetch: Fetch Red List data

Description Usage Arguments Details Value Author(s)

View source: R/RL_fetch.R

Description

Download Red List habitat and elevation data from the Red List API.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
RL_fetch(
  x,
  col.name,
  key,
  query,
  subset = 1,
  sleep_dur = 2,
  parallel = TRUE,
  num.cores = parallel::detectCores() - 1,
  verbose = 1
)

Arguments

x

List, vector, or dataframe with a column corresponding to binomial species names or IUCN Red List IDs.

col.name

Character string. Column name if x is a dataframe. Not needed if x is a list or vector.

key

Character string. IUCN Red List API key - available from https://apiv3.iucnredlist.org/api/v3/token

query

Character string. 'name' if querying by species name; 'ID' if querying by IUCN Red List ID.

subset

(optional). Numeric. Specify proportion of x to run for between 0 and 1. Defaults to 1.

sleep_dur

(optional) Numeric. Duration of sleep between API calls in seconds. Defaults to 2 seconds.

parallel

(optional) Logical. If TRUE uses multiple cores. Default is TRUE.

num.cores

(optional) Numeric. Specify number of cores to use if running in parallel. Default is number of CPU cores available - 1.

verbose

(optional) Numeric. If 0 gives no progress update, if 1 prints progress bar, if 2 prints 1 row per task completed. Default is 1.

Details

Each cell value of the output dataframe contains the pasted combination of habitat suitability and major importance, following the datasets habitats and major_importance.

If the suitability value is missing for a habitat, this is coded as 999. No habitat data available at all results in all habitats being coded as 66.

Value

A dataframe in wide format (one column per habitat category and one row per species' season).

Author(s)

Matt Lewis, matthewlewis896@gmail.com


matthewlewis896/redlistManipulatr documentation built on Jan. 22, 2022, 1:01 p.m.