Learn R Programming

rgbif (version 0.9.7)

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", ...)

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').
...
Further named parameters, such as query, path, etc, passed on to modify_url within GET call. Unnamed parameters will be combined with config.

Value

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

References

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

Examples

Run this code
## Not run: 
# occ_get(key=766766824, return='data')
# occ_get(key=766766824, 'hier')
# occ_get(key=766766824, 'all')
# 
# # many occurrences
# occ_get(key=c(101010, 240713150, 855998194), return='data')
# 
# # Verbatim data
# occ_get(key=766766824, verbatim=TRUE)
# occ_get(key=766766824, fields='all', verbatim=TRUE)
# occ_get(key=766766824, fields=c('scientificName', 'lastCrawled', 'county'), verbatim=TRUE)
# occ_get(key=c(766766824, 620594291, 766420684), verbatim=TRUE)
# occ_get(key=c(766766824, 620594291, 766420684), fields='all', verbatim=TRUE)
# occ_get(key=c(766766824, 620594291, 766420684),
#    fields=c('scientificName', 'decimalLatitude', 'basisOfRecord'), verbatim=TRUE)
# 
# # Pass in curl options
# library("httr")
# occ_get(key=766766824, config=verbose())
# # occ_get(key=766766824, config=progress())
# ## End(Not run)

Run the code above in your browser using DataLab