DOI: 10.5061/dryad.4j0zpc8ms
title: Data from: Homogeneous selection and stochasticity overrule heterogeneous selection across biotic taxa and ecosystems

description: Deterministic factors including homogeneous and heterogeneous selection
 and stochastic factors jointly shape ecological communities. However, a
 quantitative synthesis of the factors underlying the balance among
 different assembly processes is lacking. Here, we synthesized data from
 149 datasets covering major biotic groups and ecosystem types globally. We
 used a null model approach based on Raup-Crick dissimilarities and
 Bayesian meta-regression to analyze the data. We found that communities
 were more under homogeneous selection than heterogeneous selection across
 biotic taxa and ecosystems. Environment selected species homogeneously
 more often at small scales while heterogeneously more often at large
 scales. Stochasticity also showed scale-dependence as stochastic community
 assembly increased with study scale. Homogeneous and heterogeneous
 selection were strongest at high latitudes while stochastic factors were
 strongest in tropics. Marine systems had the highest degree of homogeneous
 selection and the lowest stochasticity. We provide the first analysis of
 community assembly across taxa and ecosystems which should be important
 for a better understanding of how communities respond to environmental
 change.
description: This data has been collected from  Graco-Roza et al., 2022 (https://doi.org/10.1111/geb.13513). The datasets were used to estimate Raup-Crick and NST values for pairwise comparison and later modelled to investigate the main drivers of stochasticity and deterministic assembly processes on pairs of communities.
description: # Homogeneous selection and stochasticity overrule heterogeneous selection
 across biotic taxa and ecosystems
 [https://doi.org/10.5061/dryad.4j0zpc8ms](https://doi.org/10.5061/dryad.4j0zpc8ms) This dataset contains community data from 148 datasets used in the paper by Graco-Roza et al., 2022. The community data includes environmental variables and coordinates for multiple taxonomic groups. ## Description of the Data and File Structure ### Folder Structure To ensure everything runs smoothly, create the following folders in your project directory: * `raw_data`: To include the raw dataset files. * `model`: To include the BRMS model files (e.g., .rds files). * `results_RC`: To include the results of the Raup-Crick analysis. * `results_NST`: To include the results of the NST analysis. * `table`: To include the `input_between.xlsx` which contains the METADATA for the datasets compiled from Graco-Roza et al., (2022), and to save the files generated during the `compile_results.R` script. * `Figures`: Where the figures will be saved. ### Description of Files * `raw_data.zip`: Contains (147) raw dataset files used in the analysis. * `results_NST.zip`: Contains the results of the (147 .rds files) NST analysis. * `results_RC.zip`: Contains the results of the (150 .rds files) Raup-Crick analysis. * `model.zip`: Contains saved model files (8 model .rds files) after running the BRMS models. * `table.zip`: Contains `input_between.xlsx` and files saved during the compile results script. * `run_raup_crick_analysis.R`: Script to run the Raup-Crick analysis. * `run_nst_analysis.R`: Script to run the NST analysis. * `run_brms_model.R`: Script to run the BRMS models. * `raup_crick_function.R`: Contains the Raup-Crick function used in the analysis. * `compile_results.R`: Script to compile data for models. * `analyze_and_plot_models.R`: Script to analyze and plot model results. * `create_figure_1.R`: Script to create the map figure showing dataset points and features. ### `raw_data` Folder The `raw_data` folder contains a collection of biodiversity datasets used in our analysis. Each dataset is provided in an Excel (.xlsx) format, consisting of two sheets: "species" and "coordinates". The "species" sheet contains presence/absence data for various species across different sites, while the "coordinates" sheet provides the geographical locations of these sites. #### Dataset ID The datasets are coded based on the following criteria: 1. **Hemisphere**: Indicated by the first letter (N for North, S for South). 2. **Mean Latitude**: Represented by a numeric value indicating the approximate mean absolute latitude of the sites. 3. **Realm**: Represented by a single letter indicating the realm (T for Terrestrial, M for Marine, F for Freshwaters). 4. **Biotic Group**: A two-letter abbreviation indicating the type of organisms studied. ##### Biotic Group Abbreviations * **MI**: Aquatic Macroinvertebrates * **AP**: Aquatic Vascular Plants * **AB**: Amphibians * **AT**: Arthropods * **BT**: Bats * **BD**: Benthic Diatoms * **BI**: Birds * **BP**: Bryophytes * **BF**: Butterflies * **FI**: Fishes * **FR**: Foraminifera * **FG**: Fungi * **LC**: Lichens * **CI**: Marine Ciliates * **PP**: Phytoplankton * **CO**: Reef Corals * **TP**: Terrestrial Vascular Plants ##### Example A dataset named `N21FBD.xlsx` can be interpreted as: * **N**: Northern Hemisphere * **21**: Mean absolute latitude of 21° * **F**: Freshwater realm * **BD**: Benthic Diatoms #### Sheets Description * **species**: Contains the species presence/absence data. The first column is named "ID" (site identifier), and subsequent columns represent different species with binary values indicating presence (1) or absence (0). * **coordinates**: Contains geographical coordinates of the sites. The first column is named "ID" (site identifier), and subsequent columns include latitude, longitude, and potentially other relevant geographical information. Coordinates are in WGS84 ### `table` Folder Within the file `table.zip`, the file `input_between.xlsx` is organized as follows: * **Dataset**: Unique identifier for each dataset entry. * **Organism**: Abbreviation of the biotic group to which the organism belongs (as described above). * **Realm**: The environment where the organism is found, including Marine, Freshwaters, or Terrestrial. * **Body_size**: The log-transformed body size of the organism. * **Dispersal_mode**: The dispersal mechanism of the organism, including Active, Passive, and Seeds. * **Latitude**: Mean of the Absolute Latitude coordinates of the sampling locations within the dataset. * **spa_max**: Distance in kilometers between the two furthest sites of the dataset. * **n_sites**: Number of sites sampled in the dataset. * **gamma_spe**: Total number of species included in each dataset. Within the file `table.zip`, the file `model_data_*.xlsx` is organized as follows: * **dataset**: Unique identifier for each dataset entry (similar to `input_between.xlsx`). * **rep**: Replicate identifier indicating the bootstrap iteration for each dataset. * **Var1**: Identifier for the first site in the pairwise comparison. * **Var2**: Identifier for the second site in the pairwise comparison. * **rc**: Raup-Crick value ranging from -1 to 1, representing the correlation between communities from Var1 and Var2. * **spatial.distance**: Spatial distance in kilometers between the locations of Var1 and Var2. * **lat.mean**: Mean of absolute latitude of the locations represented by Var1 and Var2. * **Organism**: Abbreviation of the biotic group to which the organism belongs (similar to `input_between.xlsx`). * **Realm**: The ecosystem where the organism is found (similar to `input_between.xlsx`). * **Body_size**: The log-transformed body size of the organism (similar to `input_between.xlsx`). * **Dispersal_mode**: The dispersal mechanism of the organism (similar to `input_between.xlsx`). * **Latitude**: Latitude of the dataset (similar to `input_between.xlsx`). * **spa_max**: Maximum spatial extent of the dataset (similar to `input_between.xlsx`). * **n_sites**: Number of sites sampled in the dataset (similar to `input_between.xlsx`). * **gamma_spe**: Gamma diversity, representing species diversity within the entire dataset (similar to `input_between.xlsx`). * **detsto**: Category indicating the type of ecological process observed, being Stochastic, Deterministic differentiation, or Deterministic homogenization. The categories are defined at different thresholds, represented in the file name indicated by *. ## Script Order 1. `run_raup_crick_analysis.R`: Run Raup-Crick analysis. 2. `run_nst_analysis.R`: Run NST analysis. 3. `compile_results.R`: Compile data for models. 4. `run_brms_model.R`: Run BRMS models. 5. `analyze_and_plot_models.R`: Analyze and plot model results. 6. `create_figure_1.R`: Create the map figure. ## Sharing/Access Information Links to other publicly accessible locations of the data: * Raw data can also be accessed from Graco-Roza et al., 2022: [https://doi.org/10.1111/geb.13513](https://doi.org/10.1111/geb.13513) Data was derived from the following sources: * Explained in the reference to Graco-Roza et al., 2022: [https://doi.org/10.1111/geb.13513](https://doi.org/10.1111/geb.13513) ## Code/Software The repository includes several scripts for processing and analyzing the data: * `run_raup_crick_analysis.R`: Runs the Raup-Crick analysis. * `nst_analysis.R`: Runs the NST analysis. * `compile_data_for_models.R`: Compiles data for models. * `run_brms_model.R`: Runs BRMS models. * `analyze_and_plot_models.R`: Analyzes and plots model results. These scripts were written in R. The scripts should be run in the specified order to reproduce the analyses and results from the study. The output of each script feeds into the next.