DOI: 10.5281/zenodo.17837949
title: Supplementary code and data for the submitted manuscript

description: Code and Data Availability (Zenodo Repository Description)

Repository Overview

This repository contains all the code and data required to reproduce the analyses and figures presented in the associated manuscript. The material is organized into three main R scripts and two structured data directories. All scripts are fully annotated to ensure transparency and reproducibility.

Folder Structure

/





clim_space_statistics.R




geo_clim_path_analysis.R




geo_clim_spaces_maps.R




combined_spaces_df/





geo_clim_space_amphibians.rds




geo_clim_space_birds.rds




geo_clim_space_mammals.rds




geo_clim_space_reptiles.rds






other_files/





geographic_gridcells/(gridcell shapefiles)




world_continents/(continent shapefile)





R Scripts

1. clim_space_statistics.R

Purpose:Runs all main statistical analyses evaluating how climate and the geography of climate influence speciation rates. The script uses mammals as an example but is fully generalizable to any tetrapod group.

Analyses included:





Effects of mean temperature and precipitation on speciation




Effects of climate geography (climate area and climate isolation)




Summary statistics and visualizations




Additional analyses using climate niche evolution rates (replace mean_temp / mean_prec with temp_bamm / prec_bamm)



Reproducing analyses for other taxa:Load the respective .rds dataset from combined_spaces_df/.

2. geo_clim_path_analysis.R

Purpose:Performs path analyses testing:





Direct effects of climatic tropicality and geographic tropicality on speciation rates




Indirect effects mediated by climate niche evolution rates



The script uses mammals as an example. Replace the input data to run analyses for amphibians, birds, or reptiles.

Outputs include:





Standardized path coefficients




Model fit indices




Path diagrams




Summary tables for main figures and supplementary material



3. geo_clim_spaces_maps.R

Purpose:Generates all climate-space and geography-space visualizations used in the manuscript.

Features:





Maps speciation rate estimates (BAMM, ClaDS, DR, MiSSE) in geographic and climate space




Maps the climate area and climate isolation in climate space




Creates the combined figure panels used in the study



To reproduce the maps for a different tetrapod class, change the input dataset.

Data Files

1. combined_spaces_df/

This folder contains the processed climate–geography–spaces datasets for each tetrapod class. Each .rds file contains one record per species × climate bin (or species × gridcell).

Variables included:





geoID: Unique gridcell identifier




long, lat: Gridcell centroid coordinates




species: Species name




grid_presence: Species presence in the gridcell




BAMM_spec: Speciation rate from BAMM




DR: Diversification rate using the DR metric




misse_spec: Speciation rate from MiSSE




claDS: Speciation rate from ClaDS2




temp_bamm, prec_bamm: Climate niche evolution rates (BAMM)




temp_bayesT, prec_bayesT: Climate niche evolution rates (Bayesian models)




climateID: Climate bin ID




tropicality: Climatic tropicality index




mean_temp, mean_prec: Mean temperature and precipitation




clim_area: Total area of the climate bin




clim_isolation: Mean geographic isolation of the climate bin




clim_fragment_n: Number of climate fragments




clim_fragment_dist: Mean distance among fragments




num_geo_cells: Number of geographic gridcells in the bin




temp_mid_bin, prec_mid_bin: Midpoints of climate bins for plotting



2. other_files/

A. geographic_gridcells/Contains the spatial grid used to map species occurrences and environmental variables. These data correspond directly to the geoID values in the main datasets.

B. world_continents/Contains the continent shapefile used for spatial visualizations and geographic analyses.

How to Reproduce the Full Workflow





Open any R script (e.g., clim_space_statistics.R).




Load the required R packages (listed at the top of each script).




Select the tetrapod group by loading the appropriate .rds file from combined_spaces_df/.




Run the script from start to finish.




Figures and tables will be generated in your working directory.



Software Requirements





R version ≥ 4.2




Commonly required packages include:tidyverse, sf, terra, raster, phytools, lavaan, phylolm, geosphere, ggplot2, viridis, cowplot, dplyr(See script headers for exact versions.)