searchgbif: Search for GBIF occurrences.

Description Usage Arguments Examples

View source: R/searchGBIF.R

Description

Search for GBIF occurrences.

Usage

1
2
searchgbif(scientificName = NULL, limit = 20, cache = FALSE, db = NULL,
  backend = "local", path = "~/")

Arguments

scientificName

Scientific name

limit

Number of results to return

cache

Logical, defaults to FALSE

db

Database

backend

One of local, redis, couchdb, mongodb, sqlite, git.

path

Path to a directory on your machine.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# Don't cache
searchgbif(scientificName='Ursus americanus', limit=2)

# Cache locally, using saveRDS
searchgbif(scientificName='Ursus americanus', limit=2, cache=TRUE, backend='local')

# Cache using redis
searchgbif(scientificName='Ursus americanus', limit=2, cache=TRUE, backend='redis')

# Cache using rcache, via the R.cache package
searchgbif(scientificName='Ursus americanus', limit=2, cache=TRUE, backend='rcache')

# Optionally, you can set mocker as options, then mocker looks for them
# This makes your function calls cleaner by avoiding the extra parameter settings
# If you use options, arguments passed in to the function call will override options settings

options(cache=TRUE)
options(backend='redis')
searchgbif(scientificName='Ursus', limit=2) # uses stored options
searchgbif(scientificName='Ursus', limit=2, cache=FALSE) # override cache option setting

## End(Not run)

ropensci/mocking documentation built on May 27, 2019, 4:34 p.m.