Learn R Programming

rgbif (version 1.3.0)

occ_get: Get data for specific GBIF occurrences.

Description

Get data for specific GBIF occurrences.

Usage

occ_get(key = NULL, return = "all", verbatim = FALSE,
  fields = "minimal", curlopts = list())

Arguments

key

Occurrence key

return

One of data, hier, meta, or all. If "data", a data.frame with the data. "hier" returns the classifications in a list for each record. meta returns the metadata for the entire call. 'all' gives all data back in a list. Ignored if verbatim=TRUE.

verbatim

Return verbatim object (TRUE) or cleaned up object (FALSE, default).

fields

(character) Default ("minimal") will return just taxon name, key, latitude, and longitute. 'all' returns all fields. Or specify each field you want returned by name, e.g. fields = c('name', 'decimalLatitude','altitude').

curlopts

list of named curl options passed on to HttpClient. see curl_options for curl options

Value

A data.frame or list of data.frame's.

References

https://www.gbif.org/developer/occurrence#occurrence

Examples

Run this code
# NOT RUN {
occ_get(key=855998194, return="data")
occ_get(key=855998194, "hier")
occ_get(key=855998194, 'all')

# many occurrences
occ_get(key=c(101010, 240713150, 855998194), return="data")

# Verbatim data
occ_get(key=855998194, verbatim=TRUE)
occ_get(key=855998194, fields='all', verbatim=TRUE)
occ_get(key=855998194, fields=c('scientificName', 'lastCrawled', 'county'),
  verbatim=TRUE)
occ_get(key=c(855998194, 620594291), verbatim=TRUE)
occ_get(key=c(855998194, 620594291), fields='all', verbatim=TRUE)
occ_get(key=c(855998194, 620594291),
   fields=c('scientificName', 'decimalLatitude', 'basisOfRecord'),
   verbatim=TRUE)

# Pass in curl options
occ_get(key=855998194, curlopts = list(verbose=TRUE))
# }

Run the code above in your browser using DataLab