Seach and retrieve data from the Global Biodiverity Information Facilty (GBIF)
rgbif is an R package to search and retrieve data from the Global Biodiverity Information Facilty (GBIF).
rgbif wraps R code around the GBIF API to allow you to talk to GBIF from R.
Install from CRAN
Or install the development version from GitHub
Search by type of record, all observational in this case
Records for Puma concolor with lat/long data (georeferened) only. Note that
occ_search() is the same as
All georeferenced records in GBIF
Records from Denmark
Number of records in a particular dataset
All records from 2012
Records for a particular dataset, and only for preserved specimens
Get possible values to be used in taxonomic rank arguments in functions
name_lookup() does full text search of name usages covering the scientific and vernacular name, the species description, distribution and the entire classification across all name usages of all or some checklists. Results are ordered by relevance as this search usually returns a lot of results.
name_lookup() returns five slots of information: meta, data, facets, hierarchies, and names. hierarchies and names elements are named by their matching GBIF key in the
data.frame in the data slot.
Search for a genus
Search for the class mammalia
Look up the species Helianthus annuus
name_usage() works with lots of different name endpoints in GBIF, listed at https://www.gbif.org/developer/species#nameUsages
name_backbone() is used to search against the GBIF backbone taxonomy
name_suggest() is optimized for speed, and gives back suggested names based on query parameters.
Get data for a single occurrence. Note that data is returned as a list, with slots for metadata and data.
Get many occurrences.
occ_get is vectorized
Note: The maximum number of records you can get with
occ_data() is 100,000. See https://www.gbif.org/developer/occurrence
occ_search() returns a
dplyr like output summary in which the data printed expands based on how much data is returned, and the size of your window. You can search by scientific name:
Or to be more precise, you can search for names first, make sure you have the right name, then pass the GBIF key to the
You can index to different parts of the oupu; here, the metadata:
You can choose what fields to return. This isn’t passed on to the API query to GBIF as they don’t allow that, but we filter out the columns before we give the data back to you.
Most parameters are vectorized, so you can pass in more than one value: