Skip to content

FRBCesab/gbif-bulk

Repository files navigation

Download and clean GBIF occurrences

License: GPL (>= 2)

Overview
Data sources
Workflow
Content
Prerequisites
Installation
Usage
Citation
Contributing
Acknowledgments
References

Overview

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.

Data sources

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.

Workflow

The analysis pipeline follows these steps:

  1. Find GBIF accepted names & identifiers from a list of accepted names
  2. Download GBIF occurrences
  3. Clean GBIF occurrences
  4. Create a world grid (spatial raster)
  5. Intersect GBIF occurrences w/ a World raster
  6. Compute species range size
  7. Compute species richness

Content

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 the README for further information.

  • analyses/: contains R scripts to run the workflow. The order to run these scripts is explained in the make.R and the description of each script is available in the header of each file.

  • outputs/: contains the outputs of the project. See the README for a complete description of the files.

Prerequisites

System requirements

This project handles spatial objects with the R packages sf and terra and require some additional software: GDAL, GEOS, and PROJ.

GBIF account

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

Installation

To install this compendium:

  • Fork this repository using the GitHub interface.
  • Clone your fork using git clone fork-url (replace fork-url by the URL of your fork). Alternatively, open RStudio IDE and create a New Project from Version Control.

Usage

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)

Citation

Please use the following citation:

Casajus N (2024) An unified workflow to retrieve and clean GBIF occurrences. URL: https://github.com/frbcesab/gbif-bulk/.

Contributing

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.

Acknowledgments

This project has been developed for FRB-CESAB research groups.

References

GBIF.org (2024) GBIF Home Page. Available from: https://www.gbif.org [25 March 2024].

About

📦 Download and clean GBIF occurrences

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages