This repository contains the analytical pipeline and data associated with the manuscript "Plant population responses to environmental variability are primarily driven by survival-reproduction trade-offs and mediated by aridity" to be published in Nature Communications. The study explores the demographic buffering continuum across diverse taxa, analyzing how population responses to environmental stochasticity are driven by life-history trade-offs and mediated by aridity.
The entire workflow—from data integration to MCMCglmm inference—is documented in a reproducible format.
- Main Framework: All primary analysis steps, logic, and figure generation are contained in
0 - Script Framework.rmd. - Output: A rendered version of the complete analysis is available in
0 - Script Framework.html.
| File | Description |
|---|---|
0 - Script Framework.rmd |
The central RMarkdown document that coordinates the full analysis. |
0 - Script Framework.html |
The compiled report showing results, visualizations, and statistical outputs. |
1 - Data cleaning and selection.R |
Script for filtering matrix singularity and selecting individual matrices. |
2 - Life history traits calculation.R |
Script for calculating demographic traits (Entropy, Age at maturity, etc.). |
MainFunction - Stochastic elasticities of variance lower level.R |
Core functions for calculating stochastic elasticities of variance ($ |
3 - Climatic variables calculation.R |
Extraction and processing of environmental metrics and stochastic noise. |
ChelsaData Download and extraction.ipynb |
Jupyter Notebook for high-resolution climate data extraction (CHELSA). |
5a - MCMCglmm - Model selection.R/.ipynb |
Preliminary model selection and comparison scripts. |
5b- MCMCglmm run.R/.ipynb |
Final Bayesian phylogenetic mixed models execution. |
references.bib |
BibTeX file with all citations (MOSAIC, COMPADRE, CHELSA, etc.). |
CleanData.RDS: Filtered population matrices and associated metadata.supertree.RDS: Phylogenetic information extracted from the MOSAIC database.LHtraits.RDS: Calculated life-history traits including reproductive window and mortality risk.climate_df.RDS: Cleaned environmental variables and PCA coordinates.buffcalc.RData: Pre-calculated demographic buffering metrics to ensure reproducibility.MCMCglmm_output.rds: Stored posterior distributions from the final statistical models.
The analysis integrates data from:
- COMPADRE & COMADRE (v.6.23.5.0): Matrix Population Models.
- MOSAIC: Unified trait database for life-history complements.
- CHELSA: High-resolution climatologies for environmental stochasticity.
This project requires R and the following key packages:
Rcompadre&Rage: Demographic calculations.MCMCglmm: Bayesian inference.tidyverse: Data wrangling and visualization.ape&phytools: Phylogenetic analysis.
Please cite the associated paper in Nature Communications: Santos et al. (In Review). Demographic buffering across the plant and animal kingdoms.
Individual dataset licenses (COMPADRE, MOSAIC, CHELSA) apply. Code is provided for reproducibility.
This README was drafted with Google Gemini.