DOI: 10.5061/dryad.41ns1rnsw
title: Code from: When and where do waterbirds need water? Inferring candidate restoration areas from spatio-temporal variation in surface water availability

description: Aim  Globally, about 850 bird species depend on surface water
 habitats either year-round or during migration. However, large-scale
 analyses examining how different groups of waterbirds are associated with
 surface water across various regions and during different seasons are
 lacking. This study analyses this relationship using high-resolution
 satellite imagery to determine when and where surface water and associated
 resources might be improved.   Location Western Palearctic
 (Europe, Middle East, Northern Africa)   Methods We correlated
 monthly counts of 40 waterbird species with surface water availability in
 the Western Palearctic at a 100 x 100 km grid cell resolution. We then
 identified where and when surface water might be limiting for waterbird
 numbers, using waterbird count data and the most recent release of
 high-resolution satellite imagery from the Copernicus project.  
 Results  Surface water availability was higher in the
 East-Atlantic flyway than in the Black Sea – Mediterranean flyway, but
 differences were small, while bird abundances (after correction for
 observation effort) were comparable. The relationship between surface
 water and waterbird abundances was typically positive and slightly
 stronger in the East-Atlantic flyway. However, it was negative during
 summer in the northern regions, where many waterbirds breed. Correlations
 were stronger for ducks and other strictly wetland-dependent birds,
 reflecting their more exclusively aquatic feeding behaviour. Crowdedness,
 calculated as the number of birds per surface water area, was higher in
 autumn compared to spring migration.   Main conclusions Our
 results confirm that the importance of surface water availability for
 waterbirds varies seasonally and geographically. In addition, our maps
 integrating bird counts and surface water help to strategically prioritise
 regions where water availability could be limiting and high crowdedness
 implies a vulnerability for waterbirds, e.g. in terms of resource
 competition or disease transmission. These include parts of the Iberian
 Peninsula, the UK, northern-central Europe, the Levant and Northern
 Africa.
description: # Code from: When and where do waterbirds need water? Inferring candidate
 restoration areas from spatio-temporal variation in surface water
 availability Dataset DOI:
 [10.5061/dryad.41ns1rnsw](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: * [Copernicus Water Bodies 100m
 database.](https://land.copernicus.eu/en/products/water-bodies/water-bodies-global-v1-0-100m) * [GBIF.org (water)bird observation data.](https://www.gbif.org/occurrence/search?occurrence_status=present)