Code from: When and where do waterbirds need water? Inferring candidate restoration areas from spatio-temporal variation in surface water availability
Data files
Oct 22, 2025 version files 15.13 MB
-
GAM_assumption_check.R
1.55 KB
-
GetGBIFOccurrenceDatasetInfo.R
695 B
-
HighlightContinousValueFunction.R
644 B
-
HTML_WhenAndWhereDoWaterbirdsNeedWater.html
14.44 MB
-
README.md
3.02 KB
-
renv.lock
527.94 KB
-
RScript_WhenAndWhereDoWaterbirdsNeedWater.Rmd
156.35 KB
Abstract
Dataset DOI: 10.5061/dryad.41ns1rnsw
Description of the data and file structure
This repository accompagnies the manuscript titled: When and where do waterbirds need water? A general approach for inferring candidate restoration areas from spatio-temporal variation in surface water availability. Submitted for review to Diversity and Distributions. This repository contains the R script (RScript_WhenAndWhereDoWaterbirdsNeedWater.Rmd), helper functions and package information to gather all the required data from openly-accessible free online sources (GBIF.org and Copernicus), compile and analyse the data and create the figures seen in the manuscript and supplementary information.
Main questions of the manuscript:
How does surface water area vary regionally and seasonally?
How dependent are 40 waterbird species on surface water area?
Are there regions where surface water area could be limiting and results in higher crowdedness, potentially causing a vulnerability for waterbirds?
Where: Western Palearctic
When: Jan 2021 - Dec 2022
Publicly accessible data used:
- Waterbird counts retrieved from gbif
- Bird observation counts retrieved from gbif
- Surface water data retrieved from Copernicus Water Bodies 100m database
Files and variables
File: RScript_WhenAndWhereDoWaterbirdsNeedWater.Rmd
Description: Main script for getting the data, analyses and making the figures.
File: renv.lock
Description: Renv lock file with all the used packages and their versions.
File: GAM_assumption_check.R
Description: Custom function for generating plots to check GAM model assumptions. It gets loaded from the working directory in the main script.
File: GetGBIFOccurrenceDatasetInfo.R
Description: Custom helper function for getting information from a certain GBIF dataset when filtering occurrences for tracking data. It gets loaded from the working directory in the main script.
File: HighlightContinousValueFunction.R
Description: Custom function for recoloring a gradient to highlight a certain value in a different color. Used in several figures. It gets loaded from the working directory in the main script.
File: HTML_WhenAndWhereDoWaterbirdsNeedWater.html
Description: HTML output of the main script markdown files. Gives the used code and shows its output.
Code/software
R v4.5 (R Core Team, 2025), using the packages tidyverse, terra, sf, mgcv, CoordinateCleaner, exactextractr and many others detailed in the renv.lock file.
Access information
Data was derived from the following sources:
