pageWhile | R Documentation |
Utility function to page through results until done.
pageWhile(FUN = f, Step = 100, maxPages = 10, verbose = TRUE)
FUN |
anonymous function with api call to pass. |
Step |
numeric step size. |
maxPages |
numeric maximum number of pages to go through. |
verbose |
logical indicating whether to print page output. |
a list all the pages called.
## Not run: key = datasetkey # f = function(datasetkey=key, ...) { # anonymous function to be run with page while x = list(...) # get Step and Page variables passed in by pageWhile prefix = "http://api.gbif.org/v1/occurrence/search?limit=0&facet=taxonKey" gbifapi::gbifapi(prefix %+% "&" %+% "datasetKey=" %+% datasetkey %+% "&" %+% gbifapi::pager(x$Step,x$Page))$facets[[1]]$counts } CL = pageWhile(FUN=f,Step=100,maxPages=1) # get pages while is not done. ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.