# NOT RUN {
# passing occ_download() requests via ...
out <- occ_download_queue(
occ_download('taxonKey = 3119195', "year = 1976"),
occ_download('taxonKey = 3119195', "year = 2001"),
occ_download('taxonKey = 3119195', "year = 2001", "month <= 8"),
occ_download('taxonKey = 5229208', "year = 2011"),
occ_download('taxonKey = 2480946', "year = 2015"),
occ_download("country = NZ", "year = 1999", "month = 3"),
occ_download("catalogNumber = Bird.27847588", "year = 1998", "month = 2")
)
# supports <= 3 requests too
out <- occ_download_queue(
occ_download("country = NZ", "year = 1999", "month = 3"),
occ_download("catalogNumber = Bird.27847588", "year = 1998", "month = 2")
)
# using pre-prepared requests via .list
keys <- c(7905507, 5384395, 8911082)
queries <- list()
for (i in seq_along(keys)) {
queries[[i]] <- occ_download_prep(
paste0("taxonKey = ", keys[i]),
"basisOfRecord = HUMAN_OBSERVATION,OBSERVATION",
"hasCoordinate = true",
"hasGeospatialIssue = false",
"year = 1993"
)
}
out <- occ_download_queue(.list = queries)
out
# another pre-prepared example
yrs <- 1930:1934
length(yrs)
queries <- list()
for (i in seq_along(yrs)) {
queries[[i]] <- occ_download_prep(
"taxonKey = 2877951",
"basisOfRecord = HUMAN_OBSERVATION,OBSERVATION",
"hasCoordinate = true",
"hasGeospatialIssue = false",
paste0("year = ", yrs[i])
)
}
out <- occ_download_queue(.list = queries)
out
# }
Run the code above in your browser using DataLab