rl_sp: Get species

Description Usage Arguments Examples

View source: R/rl_sp.R

Description

Get species

Usage

1
2
3
4
rl_sp(page = 0, key = NULL, parse = TRUE, all = FALSE, quiet = FALSE,
  ...)

rl_sp_(page, key = NULL, all = FALSE, quiet = FALSE, ...)

Arguments

page

(integer/numeric) Page to get. Default: 0. you can get up to 10,000 records per page. Paging is required because it's too much burden on a server to just "get all the data" in one request

key

A IUCN API token. See rl_use_iucn.

parse

(logical) Whether to parse to list (FALSE) or data.frame (TRUE). Default: TRUE

all

(logical) to get all results or not. Default: FALSE. this means we do the paging internally for you. result is a list of results, so you have to bind them together yourself into a data.frame, see example

quiet

(logical) give progress for download or not. Default: FALSE (that is, give progress). ignored if all = FALSE

...

Curl options passed to HttpClient

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
rl_sp(page = 3)

# get all results
out <- rl_sp(all = TRUE)
length(out)
vapply(out, "[[", 1, "count")
all_df <- do.call(rbind, lapply(out, "[[", "result"))
head(all_df)
NROW(all_df)

## End(Not run)

rredlist documentation built on July 20, 2018, 1 a.m.