Baseline temperature and precipitation govern how Neotropical mountain plants respond to warming
Year: 2026
Type: article
Abstract: Overview This repository contains the R code used to reproduce the analyses and some of the supplemnetary figures in the paper. The study reconstructs elevational shifts of Neotropical mountain plant assemblages across the Northern Andes using a weighted-averaging (WA) transfer function applied to palaeoecological-style assemblage data, and tests how baseline climate and climate change magnitude govern those shifts using Bayesian hierarchical models. Reproducing the analysis Run scripts in the following order from the project root (or open Elevation_shift_Andes.Rproj in RStudio): Step Script Description 0 0_Configurations.R Sourced automatically by all other scripts 1 1_Data_assemblages.R Builds training and observation assemblage datasets 2 2_Climate_data.R Attaches 5-year mean CHELSA climate to each assemblage 3 3_Ordination.R Ordination and outlier removal 4 4_Transferfunction.R WA transfer function, kriging correction, db_results_r 5 5_Drivers.R Adds climatic drivers, db_models_r 6 6_Autorcorr_spatial_corr.R Spatial autocorrelation diagnostics 7.0 7_0 Bayesian_models.R Spatial null model; writes fit_null.rds and db_models_scaled.rds 7.1–7.3 7_1 – 7_3 Bayesian_models.R Interaction model families 7.4 7_4_Selection_model.R Variable selection and final model — Anomalies.R Climate anomaly computation (independent of main pipeline) — Breaking point.R Temperature break-point analysis (independent) — Genus_level.R Genus-level replication of the transfer function (independent) Note: Scripts 7.1–7.4 depend on envi/fit_null.rds and outputs/db_models_scaled.rds produced by 7_0 Bayesian_models.R. External data requirements The following datasets are required but not included in this repository: Dataset Used for Put it in Source CHELSAcruts bioclimatic layers, Northern Andes assemblage climate (scripts 2, 5) and anomalies input/CHELSA/ chelsa-climate.org CHELSA WL 1901–2016 mean temperature break-point analysis input/CHELSA_WL_1901_2016/Temp/ chelsa-climate.org GMBA Mountain Inventory v1.2 Andes cordillera boundaries (scripts 4, Anomalies.R, Genus_level.R, Breaking point.R) input/GMBA/ gmba.unibe.ch The scripts read these from the paths above, relative to the project root; no absolute paths are used. Starting part-way through Rebuilding from script 1 needs the CHELSA layers. To skip that, outputs/RDS_files/training_rounded.rds and obs_rounded.rds are included: they hold the assemblage and climate data produced by scripts 1–2, so the analysis can be run from 3_Ordination.R onward without any external download. Software requirements R ≥ 4.3 Key packages: tidyverse, brms, rstan, cmdstanr, analogue, fxTWAPLS, vegan, ggvegan, sf, terra, automap, projpred, tidybayes, kableExtra, sjPlot Install all packages by running R/0_Configurations.R (it checks for missing packages and installs them automatically for the packages listed there; others must be installed manually). Repository structure ├── R/ # Analysis scripts (run in order) │ ├── 0_Configurations.R # Packages, theme, colour definitions │ ├── 1_Data_assemblages.R # Read and filter assemblage data; define training/observation sets │ ├── 2_Climate_data.R # Extract 5-year CHELSA climate averages for each assemblage │ ├── 3_Ordination.R # DCA and NMDS ordination; outlier filtering │ ├── 4_Transferfunction.R # WA-PLS and WA transfer functions; spatial residual kriging │ ├── 5_Drivers.R # Extract climatic drivers │ ├── 6_Autorcorr_spatial_corr.R# Correlation matrix; spatial autocorrelation checks │ ├── 7_0 Bayesian_models.R # Univariate models with spatial random effect │ ├── 7_1 Bayesian_models.R # Baseline × baseline interaction models │ ├── 7_2 Bayesian_models.R # Baseline × delta interaction models │ ├── 7_3 Bayesian_models.R # Delta × delta interaction models │ ├── 7_4_Selection_model.R # Projection-predictive variable selection; final model │ ├── Anomalies.R # Spatial temperature and precipitation anomaly computation │ ├── Breaking point.R # Structural break-point analysis of the temperature series │ └── Genus_level.R # Genus-level transfer function and elevation shift analysis │ ├── input/ # Input data (not versioned if large) │ ├── assemblages_complete.csv # Full plant assemblage database │ ├── DEM_Andes.tif # Digital elevation model — Northern Andes │ ├── outputs/ # Reproducible outputs (tables, rasters, model HTML summaries) │ └── RDS_files/ # Intermediate RDS objects (training and observation lists) │ ├── envi/ # Saved R environments (not versioned — regenerated by scripts) ├── figures/ # Generated figures (not versioned — regenerated by scripts) ├── Elevation_shift_Andes.Rproj └── README.md Licence Code: MITData: CC-BY 4.0 — please cite the paper when using the assemblage data or derived outputs.
Authors: Pacheco Riaño, Laura Camila, Aguirre, Nikolay, Baez, Selene, Baruffol, Martin, Bjorkman, Anne, David Leonardo, Campos Rodriguez, Cuesta, Francisco, Eguiguren, Paul, Fajardo-Gutiérrez, Francisco, Jiménez Restrepo, Diana Isabel, León Moya, Olga Adriana, Llambí, Luis Daniel, Cesar, Marín, Muriel, Priscilla, Ojeda Luna, Tatiana, Ordonez Barragan, Jenny Cristina, Peyre, Gwendolyn, Pinto, Esteban, Rumpf, Sabine, Suarez Ballesteros, Carlos Ivan, Flantua, Suzette, Grytnes, John-Arvid
Institutions: University of Gothenburg, Universidad Nacional de Loja, Polytechnic School of Algiers, National Polytechnic School, Universidad San Francisco de Quito, Technical University of Munich, Pontificia Universidad Católica del Ecuador, Universidad de Los Andes, Universidad de Los Andes, University of Basel, University of Bergen
Language: English
Subfield: Ecological Modeling
Field: Environmental Science
Domain: Physical Sciences
SDGs: Climate action, Life on land
Open Access status: green
OpenAlex ID: W7214944817
