Learn R Programming

rgbif (version 1.3.0)

GbifQueue: GBIF download queue

Description

GBIF download queue

Arguments

...

any number of occ_download() requests

.list

any number of occ_download() requests as lazy objects, called with e.g., lazyeval::lazy()

Details

Methods

add(x)

Add single jobs to the queue

add_all()

Add all jobs to the queue

remove(x)

Remove a job from the queue

jobs()

Give number of jobs in the queue

next_()

Get the next job in the queue. if no more jobs, returns empty list

last_()

Get the last job in the queue. if no more jobs, returns empty list

Examples

Run this code
# NOT RUN {
x <- GbifQueue$new(
  occ_download('taxonKey = 3119195', "year = 1976"),
  occ_download('taxonKey = 3119195', "year = 2001"),
  occ_download('taxonKey = 3119195', "year = 2001", "month <= 8"),
  occ_download('taxonKey = 3119195', "year = 2004"),
  occ_download('taxonKey = 3119195', "year = 2005")
)
x
x$reqs
x$add_all()
x$jobs()
x
x$remove(x$reqs[[1]])
x
x$reqs[[1]]$run()
x$reqs[[1]]$result

# pre-prepared download request
z <- occ_download_prep(
  "basisOfRecord = HUMAN_OBSERVATION,OBSERVATION",
  "hasCoordinate = true",
  "hasGeospatialIssue = false",
  "year = 1993",
  user = "foo", pwd = "bar", email = "foo@bar.com"
)
out <- GbifQueue$new(.list = list(z))
out
out$reqs
# }

Run the code above in your browser using DataLab