
Get current CITES appendix listings and reservations
Source:R/spp_cites_legislation.R
spp_cites_legislation.RdRetrieve current CITES appendix listings and reservations, CITES quotas, and CITES suspensions for a given taxon concept.
Usage
spp_cites_legislation(
taxon_id,
scope = "current",
language = "en",
raw = FALSE,
token = NULL,
verbose = TRUE,
pause = 1,
...
)Arguments
- taxon_id
a vector of character strings containing species' taxon concept identifiers (see
spp_taxonconcept()).- scope
vector of character strings indicating the time scope of legislation, values are taken among
current,historicandall. Default iscurrent.- language
vector of character strings indicating the language for the text of legislation notes, values are taken among
en(English),fr(French) andes(Spanish). Default isen.- raw
a logical. Should raw data be returned?
- token
a character string containing the authentification token, see https://api.speciesplus.net/documentation. Default is set to
NULLand requires the environment variableSPECIESPLUS_TOKENto be set directly inRenviron. Alternatively,set_token()can be used to setSPECIESPLUS_TOKENfor the current session.- verbose
a logical. Should extra information be reported on progress?
- pause
a duration (in second) to suspend execution for (see
Sys.sleep()). This was added cause the web API returns a 404 error too many requests in a short time interval.- ...
Further named parameters, see
httr::GET().
Value
If raw is set to TRUE then an object of class spp_raw (or
spp_raw_multi if length(taxon_id) > 1) is returned which is essentially
a list of lists (see option as = 'parsed' in httr::content()).
Otherwise, an object of class spp_cites_leg (or spp_cites_leg_multi if
length(taxon_id)>1) is returned which is a list of three data frames:
cites_listings: lists CITES annex listings EU suspensions,cites_quotas: lists CITES quotas,cites_suspensions: lists CITES suspensions.
Examples
if (FALSE) { # \dontrun{
# this calls will only work if a token is set and valid
res1 <- spp_cites_legislation(taxon_id = 4521)
res2 <- spp_cites_legislation(taxon_id = c('4521', '3210', '10255'))
res3 <- spp_cites_legislation(taxon_id = 4521, scope = 'all',
verbose = FALSE, config=httr::verbose())
res4 <- spp_cites_legislation(taxon_id = 4521, language = 'fr')
} # }