Learn R Programming

rgbif (version 3.8.1)

occ_get: Get data for GBIF occurrences by occurrence key

Description

Get data for GBIF occurrences by occurrence key

Usage

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

occ_get_verbatim(key, fields = "minimal", curlopts = list())

Value

For occ_get a list of lists. For occ_get_verbatim a data.frame

Arguments

key

(numeric/integer) one or more occurrence keys. required

fields

(character) Default ("minimal") will return just taxon name, key, latitude, and longitude. '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::curl_options for curl options

return

Defunct. All components are returned now; index to the one(s) you want

verbatim

Defunct. verbatim records can now be retrieved using occ_get_verbatim()

References

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

Examples

Run this code
if (FALSE) {
occ_get(key=855998194)

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

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

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

Run the code above in your browser using DataLab