# NOT RUN {
# if you send a taxon name, an IUCN API key is required
## here, the key is being detected from a .Rprofile file
## or .Renviron file, See "Redlist Authentication" above
iucn_summary("Lutra lutra")
ia <- iucn_summary(c("Panthera uncia", "Lynx lynx"))
ia <- iucn_summary(c("Panthera uncia", "Lynx lynx", "aaa"))
## get detailed distribution
iac <- iucn_summary(x="Ara chloropterus", distr_detail = TRUE)
iac[[1]]$distr
# If you pass in an IUCN ID, you don't need to pass in a Redlist API Key
ia <- iucn_summary_id(c(22732, 12519))
# extract status
iucn_status(ia)
# extract other available information
ia[['Lynx lynx']]$history
ia[['Panthera uncia']]$distr
ia[[2]]$trend
## the outputs aren't quite identical, but we're working on it
identical(
iucn_summary_id(c(22732, 12519)),
iucn_summary(as.iucn(c(22732, 12519)))
)
# using parallel, e.g., with doMC package, register cores first
# library(doMC)
# registerDoMC(cores = 2)
# nms <- c("Panthera uncia", "Lynx lynx", "Ara chloropterus", "Lutra lutra")
# (res <- iucn_summary(nms, parallel = TRUE))
# }
Run the code above in your browser using DataLab