if (FALSE) {
if (interactive()) { # dont run in automated example runs, too costly
# passing occ_download() requests via ...
out <- occ_download_queue(
occ_download(pred('taxonKey', 3119195), pred("year", 1976)),
occ_download(pred('taxonKey', 3119195), pred("year", 2001)),
occ_download(pred('taxonKey', 3119195), pred("year", 2001),
pred_lte("month", 8)),
occ_download(pred('taxonKey', 5229208), pred("year", 2011)),
occ_download(pred('taxonKey', 2480946), pred("year", 2015)),
occ_download(pred("country", "NZ"), pred("year", 1999),
pred("month", 3)),
occ_download(pred("catalogNumber", "Bird.27847588"),
pred("year", 1998), pred("month", 2))
)
# supports <= 3 requests too
out <- occ_download_queue(
occ_download(pred("country", "NZ"), pred("year", 1999), pred("month", 3)),
occ_download(pred("catalogNumber", "Bird.27847588"), pred("year", 1998),
pred("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(
pred("taxonKey", keys[i]),
pred_in("basisOfRecord", c("HUMAN_OBSERVATION","OBSERVATION")),
pred("hasCoordinate", TRUE),
pred("hasGeospatialIssue", FALSE),
pred("year", 1993)
)
}
out <- occ_download_queue(.list = queries)
out
# another pre-prepared example
yrs <- 1930:1934
queries <- list()
for (i in seq_along(yrs)) {
queries[[i]] <- occ_download_prep(
pred("taxonKey", 2877951),
pred_in("basisOfRecord", c("HUMAN_OBSERVATION","OBSERVATION")),
pred("hasCoordinate", TRUE),
pred("hasGeospatialIssue", FALSE),
pred("year", yrs[i])
)
}
out <- occ_download_queue(.list = queries)
out
}}
Run the code above in your browser using DataLab