searchgbif: Search for GBIF occurrences.

View source: R/searchGBIF.R

searchgbifR Documentation

Search for GBIF occurrences.

Description

Search for GBIF occurrences.

Usage

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

## 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 18, 2022, 5:38 p.m.