if (FALSE) {
## the plant class Bangiophyceae
gbif_downstream(id = 198, downto="genus")
gbif_downstream(id = 198, downto="genus", intermediate=TRUE)
# families downstream from the family Strepsiptera (twisted wing parasites)
gbif_downstream(id = 1227, "family")
## here, intermediate leads to the same result as the target
gbif_downstream(id = 1227, "family", intermediate=TRUE)
if (interactive()) {
# Lepidoptera
gbif_downstream(id = 797, "family")
# get species downstream from the genus Ursus
gbif_downstream(id = 2433406, "species")
# get tribes down from the family Apidae
gbif_downstream(id = 7799978, downto="species")
gbif_downstream(id = 7799978, downto="species", intermediate=TRUE)
# names that don't have canonicalname entries for some results
# Myosotis: key 2925668
key <- 2925668
res <- gbif_downstream(key, downto = "species")
res2 <- downstream(key, db = "gbif", downto = "species")
# Pagination
# GBIF limits queries to a maximum of 1000 records per request, so if
# there's more than 1000, use the start parameter
# Piper, taxonKey = 3075433
x1 <- gbif_downstream(id = 3075433, downto = "species", limit=1000)
x2 <- gbif_downstream(id = 3075433, downto = "species", limit=1000,
start=1000)
x3 <- gbif_downstream(id = 3075433, downto = "species", limit=1000,
start=2000)
x4 <- gbif_downstream(id = 3075433, downto = "species", limit=1000,
start=3000)
rbind(x1, x2, x3, x4)
}
}
Run the code above in your browser using DataLab