If you want to query all taxa, you can use spp_taxonconcept()
with query_taxon = ""
(assuming your token is already set up):
#> → Retrieving info from page 1 ........................✔
#> ── 10 pages available, retrieving info from 9 more ────────────────────────
#> → Retrieving info from page 2 ........................✔
#> → Retrieving info from page 3 ........................✔
#> → Retrieving info from page 4 ........................✔
#> → Retrieving info from page 5 ........................✔
#> → Retrieving info from page 6 ........................✔
#> → Retrieving info from page 7 ........................✔
#> → Retrieving info from page 8 ........................✔
#> → Retrieving info from page 9 ........................✔
#> → Retrieving info from page 10 .......................✔
#> [1] 2863 7
Alternatively, you can retrieve, for example, the first three pages of results returned by the API.
#> → Retrieving info from page 1 ........................✔
#> ── 154 pages available, retrieving info from 1 more ───────────────────────
#> → Retrieving info from page 2 ........................✔
#> [1] 1000 8
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.
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)
#>
#> 10255 3210 4521
#> 15 8 42
#> taxon_id id taxon_concept_id is_current appendix change_type
#> 1 4521 3666 4521 TRUE II +
#> 2 4521 3665 4521 TRUE I +
#> 3 4521 3645 4521 TRUE I R+
#> 4 3210 4661 3210 TRUE II +
#> 5 10255 4645 10255 TRUE I +
#> effective_at
#> 1 2007-09-13
#> 2 2007-09-13
#> 3 1990-01-18
#> 4 1987-10-22
#> 5 2005-01-12
#> taxon_id id taxon_concept_id is_current annex change_type
#> 1 4521 27868 4521 TRUE B +
#> 2 4521 27801 4521 TRUE A +
#> 3 3210 27900 3210 TRUE B +
#> 4 10255 27846 10255 TRUE A +
#> effective_at
#> 1 2017-02-04
#> 2 2017-02-04
#> 3 2017-02-04
#> 4 2017-02-04
res4 <- spp_references(taxon_id = vc_txn, verbose = FALSE)
## Number of references per taxon ID
table(res4$references$taxon_id)
#>
#> 10255 3210 4521
#> 1 3 15