Skip to content

diegotrindade/TraitTimeLagsMarine

Repository files navigation

TraitTimeLagsMarine

This repository contains the data, scripts, and outputs used to analyse time-lagged biodiversity responses (extinction debt and immigration credit) in benthic megafaunal communities of the Dogger Bank (North Sea), using suitability estimates from observed and dark diversity.

The repository is organised to allow full reproducibility of the analyses and figures presented in the associated manuscript.

Reproducibility

This project uses a two-layer approach to ensure reproducibility:

  • rig (R Installation Manager) to manage the R version

  • renv to manage package dependencies

The required R version (4.4.0) is recorded in renv.lock and in the file .R-version, which is read by rig (version 0.7.1) to ensure the correct R version is used.


Setup instructions
1. Install rig

rig must be installed outside R.

Windows, macOS, Linux:
https://rig.r-pkg.org

(On Windows, use the installer from the GitHub releases page.)

Verify installation:

rig --version

2. Install the required R version

From a terminal or PowerShell:

rig install 4.4.0
rig default 4.4.0

Please note that R version switching is not automatic. Before restoring the project environment, after installing the used version, users must ensure that R 4.4.0 is the active R version, for example using rig default:

rig install 4.4.0   # skip it if already installed
rig default 4.4.0

Then, use renv and the Quarto script (scripts/script_GCB_MarineDD.qmd) to reproduce the analyses:


# install renv if needed
install.packages("renv")

# restore the project environment
renv::restore()

# Then open and render:

scripts/script_GCB_MarineDD.qmd

Folder descriptions

  • data/

Input datasets used in the analyses.

`coordinates.csv`
Geographic coordinates of sampling stations.

`comm_data.csv`
Community data including species occurrences by station and year.

`trait_df.csv`
Species trait data, including body size and motility.
  • figs/

Figures generated for the manuscript.

  `MainFigs/`
Final versions of figures included in the main text (except Figure 1, which was created using Inkscape).

  `SuppFigs/`
Supplementary figures.

  `silhouettes/`
SVG silhouette files used for species illustrations (e.g. Figure 5).
  • rdsFiles/

Intermediate .rds objects used in the analyses to avoid repeated data processing and ensure reproducibility.

Examples include:

GBIF-derived taxonomic information (e.g. phylum assignment)

Processed temperature data

  • scripts/


Scripts used to run all analyses and generate figures.

 `script_GCB_MarineDD.qmd`


Quarto document containing the full analysis workflow, including:

data processing; 
suitability and dark diversity estimation; 
trait-based analyses; 
statistical models; 
main and supplementary figures

renv/

Project-specific R environment managed with renv. This ensures package versions are fixed and analyses remain reproducible.

Data sources and notes

Analyses were developed and run using R version 4.4.0.

Temperature data were obtained from the Copernicus Marine Environment Monitoring Service (CMEMS).

Trait information was compiled from published sources and the WoRMS database.

Some intermediate .rds files are included to improve computational efficiency and future reproducibility.

Citation

If you use data, code, or ideas from this repository, please cite the associated manuscript:

[Citation will be added upon publication]

License

Code and data in this repository are shared for reuse with attribution. Please cite this repository and the associated paper when using any part of the material.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors