Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

GbifQueue

GbifQueue


Description

GBIF download queue

Public fields

reqs

(list) a named list of objects of class occ_download()

queue

(list) holds the queued jobs

Methods

Public methods


Method print()

print method for the GbifQueue class

Usage
GbifQueue$print(x, ...)
Arguments
x

self

...

ignored


Method new()

Create a new GbifQueue object

Usage
GbifQueue$new(..., .list = list())
Arguments
...

any number of occ_download() requests

.list

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

Returns

A new GbifQueue object


Method add()

Add single jobs to the queue

Usage
GbifQueue$add(x)
Arguments
x

an occ_download() object

Returns

nothing returned; adds job (x) to the queue


Method add_all()

Add all jobs to the queue

Usage
GbifQueue$add_all()
Returns

nothing returned


Method remove()

Remove a job from the queue

Usage
GbifQueue$remove(x)
Arguments
x

an occ_download() object

Returns

nothing returned


Method next_()

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

Usage
GbifQueue$next_()
Returns

next job or empty list


Method last_()

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

Usage
GbifQueue$last_()
Returns

last job or empty list


Method jobs()

Get number of jobs in the queue

Usage
GbifQueue$jobs()
Returns

(integer) number of jobs


Method clone()

The objects of this class are cloneable with this method.

Usage
GbifQueue$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Not run: 
if (interactive()) { # dont run in automated example runs, too costly
x <- GbifQueue$new(
  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', 3119195), pred("year", 2004)),
  occ_download(pred('taxonKey', 3119195), pred("year", 2005))
)
x
x$reqs
x$add_all()
x
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(
  pred_in("basisOfRecord", c("HUMAN_OBSERVATION","OBSERVATION")),
  pred("hasCoordinate", TRUE),
  pred("hasGeospatialIssue", FALSE),
  pred("year", 1993),
  user = "foo", pwd = "bar", email = "foo@bar.com"
)
out <- GbifQueue$new(.list = list(z))
out
out$reqs
}
## End(Not run)

rgbif

Interface to the Global 'Biodiversity' Information Facility API

v3.5.2
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>), Damiano Oldoni [aut] (<https://orcid.org/0000-0003-3445-7562>), Vijay Barve [ctb] (<https://orcid.org/0000-0002-4852-2567>), Peter Desmet [ctb] (<https://orcid.org/0000-0002-8442-8025>), Laurens Geffert [ctb], Dan Mcglinn [ctb] (<https://orcid.org/0000-0003-2359-3526>), Karthik Ram [ctb] (<https://orcid.org/0000-0002-0233-1757>), rOpenSci [fnd] (https://ropensci.org/)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.