rgbif is an R package which gives you access to GBIF mediated data via its REST API.
GBIF (the Global Biodiversity Information Facility) is an international network and data infrastructure funded by the world’s governments and aimed at providing anyone, anywhere, open access to data about all types of life on Earth.
Installation
install.packages("rgbif") # CRAN version
pak::pkg_install("ropensci/rgbif") # dev version
install.packages("rgbif", repos="https://dev.ropensci.org") # dev versionGetting Started
⚠️ Breaking Change in rgbif 3.9.0: The default taxonomy changed from GBIF Backbone to COL (Catalogue of Life) Extended Release, which uses alpha-numeric taxon keys instead of numeric keys. See the Migration Guide for details on updating your code.
There are several long-form articles that can help get you started:
Most GBIF users are interested in getting lat-lon occurrence records.
occ_search(scientificName = "Pan troglodytes")
occ_data(scientificName = "Pan troglodytes")It is usually better to get occurrence records using a taxonKey. See the article Working With Taxonomic Names.
taxonKey <- name_backbone("Pan troglodytes")$usageKey
occ_search(taxonKey = taxonKey)GBIF strongly recommends the use of occ_download() rather than occ_search() for serious research projects. See article Getting Occurrence Data From GBIF.
If repeated requests are made to the GBIF search API via
occ_search(), users will be temporatily paused for 5 seconds. Please useocc_download()for bulk downloads.
It is required to set up your GBIF credentials to make downloads from GBIF.
# By default, name_backbone() and occ_download() use COL (Catalogue of Life) Extended Release
# which returns alpha-numeric taxon keys (e.g., "4C92G" for Pan troglodytes)
taxonKey <- name_backbone("Pan troglodytes")$usageKey
occ_download(pred("taxonKey", taxonKey))
# For GBIF Backbone Taxonomy, explicitly set checklistKey to the backbone UUID
backbone_uuid <- "d7dddbf4-2cf0-4f39-9b2a-bb099caae36c"
taxonKey_gbif <- name_backbone("Pan troglodytes", checklistKey = backbone_uuid)$usageKey
occ_download(pred("taxonKey", taxonKey_gbif), checklistKey = backbone_uuid)
# 4C92G taxonKey for Pan troglodytes in COL Extended ReleaseCitation
Under the terms of the GBIF data user agreement, users who download data agree to cite a DOI. Please see GBIF’s citation guidelines and Citing GBIF Mediated Data.
Please also cite rgbif by running citation(package = "rgbif").
Contributors
This list honors all contributors in alphabetical order. Code contributors are in bold.
adamdsmith - AgustinCamacho - AldoCompagnoni - AlexPeap - andzandz11 - AshleyWoods - AugustT - barthoekstra - benmarwick - cathynewman - cboettig - coyotree - damianooldoni - dandaman - djokester - dlebauer - dmcglinn - dmi3kno - dnoesgaard - DupontCai - ecology-data-science - EDiLD - elgabbas - emhart - fxi - ghost - gkburada - hadley - Huasheng12306 - ibartomeus - JanLauGe - jarioksa - jeroen - jhnwllr - jhpoelen - jivelasquezt - jkmccarthy - johnbaums - jtgiermakowski - jwhalennds - karthik - kgturner - Kim1801 - ljuliusson - ljvillanueva - luisDVA - martinpfannkuchen - MattBlissett - MattOates - maxhenschell - mdsumner - no-la-ngo - Octoberweather - omahs - Pakillo - peterdesmet - PhillRob - PietrH - poldham - qgroom - raymondben - rossmounce - sacrevert - sagitaninta - sckott - scottsfarley93 - simon-tarr - SriramRamesh - stevenpbachman - stevensotelo - stevenysw - TomaszSuchan - tphilippi - vandit15 - vervis - vijaybarve - willgearty - Xuletajr - yvanlebras - zixuan75
Meta
- Please report any issues or bugs.
- License: MIT
- Get citation information for
rgbifin R doingcitation(package = 'rgbif') - Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
There are similar GBIF clients in other languages :
This package is part of spocc, along with several other packages, that provide access to occurrence records from multiple data sources.
