DOI: 10.5061/dryad.jh9w0vtm5
title: Resolving the context-dependency of local heterogeneity-diversity relationships across rocky reefs worldwide

description: Environmental heterogeneity is widely thought to promote biodiversity, yet
 its variable effects limit its predictive power. This variability can be
 better understood by considering key mediating factors: different forms of
 local heterogeneity, organismal groups and their associated traits, and
 the broader environmental context (e.g., latitude, substrate type). To
 address these factors, we analysed 144 studies (24,412 data points and
 2,815 effects) from rocky reefs worldwide. Heterogeneity was defined as
 spatial variability in an area, and heterogeneity metrics were grouped
 into facets such as three-dimensional structure (e.g., substrate
 rugosity), complexity (e.g., fractal dimension), and feature variability
 (e.g., mussel size classes). All facets promoted biodiversity, but effects
 were context-dependent, with three-dimensional structures having the
 strongest impact, likely due to increased niche provision and substrate
 area. Responses also varied across organismal groups, with small-bodied
 and mobile species benefiting most. Additionally, heterogeneity reduced
 grazing and enhanced recruitment, helping promote biodiversity. Effects
 were strongest on biogenic substrates, at lower latitudes, and in more
 stressful intertidal zones. Overall, the influence of local heterogeneity
 would depend on how it is generated and measured, organisms’ traits, and
 prevailing environmental conditions. These insights inform the development
 of a conceptual model predicting heterogeneity’s context-dependent effects
 on biodiversity across systems.
description: # Resolving the context-dependency of local heterogeneity - diversity
 relationships across rocky reefs worldwide
 [https://doi.org/10.5061/dryad.jh9w0vtm5](https://doi.org/10.5061/dryad.jh9w0vtm5) This repository provides the data and code used to produce the results presented in Sola & Griffin (2024): *Resolving the context-dependency of local heterogeneity-diversity relationships: a framework and key moderators from rocky reefs worldwide.*  Following a metanalytical approach, heterogeneity effects in rocky reef literature were analysed to assess the effects of heterogeneity facet, organismal group, environmental context and ecological processes on the strength and shape of HDRs. This approach allowed to develop an operational framework of heterogeneity metrics linked to multiple forms of heterogeneity at the local scale, or ‘heterogeneity facets’ (e.g., Heidrich et al. 2020). ## Description of the data and file structure Here, you can find the code used to compute the effect sizes used in the metanalyses, the models run to assess heterogeneity effects, and the code produced to present model outputs in the Results section. ## Code/Software To run the software, first download the data and run the code in the Data folder. All metadata can be found in the Metadata file. First, run the “Compute_EffectsSizes.R” file to obtain the effect size data used for the models. Once the effect sizes have been computed, you can run all the “Models” files – which are separated into Facets, Organismal Groups, Ecological Processes, Environmental Context and models used in Supplementary Materials. Finally, in the “Plot” files you can find the code to produce the plots used to prepare the figures in the Results section. ## References Heidrich, L., Bae, S., Levick, S., Seibold, S., Weisser, W., Krzystek, P., ... & Müller, J. (2020). Heterogeneity–diversity relationships differ between and within trophic levels in temperate forests. *Nature Ecology & Evolution*, *4*(9), 1204-1212..