Bulk analysis with rcites

rcites team

15-08-2018

Broad taxon concept queries

If you want to query all taxa, you can use spp_taxonconcept() with query_taxon = "" (assuming your token is already set up):

res_cms <- spp_taxonconcept("", taxonomy = "CMS") #slow
dim(res_cms$general)

Alternatively, you can retrieve, for example, the first three pages of results returned by the API.

res_cites <- spp_taxonconcept("", page = 1:2)
dim(res_cites$general)

Retrieving information for a set of taxon_concept ID

All spp_ functions (i.e. spp_distributions(), spp_eu_legislation(), spp_cites_legislation() and spp_references()) can handle a vector of taxon_id which allows bulk analysis. Below we exemplify this feature for the four functions.

spp_distributions()

vc_txn <- c('4521', '3210', '10255')
res1 <- spp_distributions(taxon_id = vc_txn, verbose = FALSE)
## Number of countries concerned per taxon ID
table(res1$distributions$taxon_id)

spp_cites_legislation()

res2 <- spp_cites_legislation(taxon_id = vc_txn, verbose = FALSE)
res2$cites_listings

spp_eu_legislation()

res3 <- spp_eu_legislation(taxon_id = vc_txn, verbose = FALSE)
res3$eu_listings

spp_references()

res4 <- spp_references(taxon_id = vc_txn, verbose = FALSE)
## Number of references per taxon ID
table(res4$references$taxon_id)