• Overview
• Data
sources
• Workflow
•
Content
•
Prerequisites
•
Installation
•
Usage
• Citation
•
Contributing
•
Acknowledgments
•
References
This project aims to provide an unified workflow to retrieve and clean GBIF occurrences for a given list of species. Occurrences are finally aggregated on a World grid to compute species range sizes (number of cells) and species richness.
This project uses the following databases:
Database | Usage | Reference | Link |
---|---|---|---|
GBIF | Get occurrences at World scale | GBIF.org (2024) | link |
Natural Earth | Create a World grid | None | link |
A comprehensive description of all these databases is available here.
The analysis pipeline follows these steps:
- Find GBIF accepted names & identifiers from a list of accepted names
- Download GBIF occurrences
- Clean GBIF occurrences
- Create a world grid (spatial raster)
- Intersect GBIF occurrences w/ a World raster
- Compute species range size
- Compute species richness
This repository is structured as follow:
-
DESCRIPTION
: contains project metadata (author, description, license, dependencies, etc.). -
make.R
: main R script to set up and run the entire project. Open this file to follow the workflow step by step. -
R/
: contains R functions developed especially for this project. -
data/
: contains raw data used in this project. See theREADME
for further information. -
analyses/
: contains R scripts to run the workflow. The order to run these scripts is explained in themake.R
and the description of each script is available in the header of each file. -
outputs/
: contains the outputs of the project. See theREADME
for a complete description of the files.
This project handles spatial objects with the R packages
sf
and
terra
and require some additional
software: GDAL, GEOS, and PROJ.
A GBIF account is required to download GBIF occurrences as ZIP files.
First, create a GBIF account by visiting this page
https://www.gbif.org/user/profile. Then, store your login information
locally in the ~/.Renviron
file. Use the function
usethis::edit_r_environ()
to create/open this file and add the
following three lines:
GBIF_USER='your_username'
GBIF_PWD='your_password'
GBIF_EMAIL='your_email'
Restart R, and check if everything is ok:
Sys.getenv("GBIF_USER")
Sys.getenv("GBIF_PWD")
Sys.getenv("GBIF_EMAIL")
To install this compendium:
- Fork this repository using the GitHub interface.
- Clone
your fork using
git clone fork-url
(replacefork-url
by the URL of your fork). Alternatively, open RStudio IDE and create a New Project from Version Control.
Launch the
make.R
file
with:
source("make.R")
Notes
- All required packages listed in the
DESCRIPTION
file will be installed (if necessary) - All required packages and R functions will be loaded
- Each script in
analyses/
can be run independently - Some steps listed in the
make.R
might take time (several hours)
Please use the following citation:
Casajus N (2024) An unified workflow to retrieve and clean GBIF occurrences. URL: https://github.com/frbcesab/gbif-bulk/.
All types of contributions are encouraged and valued. For more information, check out our Contributor Guidelines.
Please note that this project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
This project has been developed for FRB-CESAB research groups.
GBIF.org (2024) GBIF Home Page. Available from: https://www.gbif.org [25 March 2024].