A unified model explaining the unimodal relationship between productivity and species richness in fish communities
Data files
Oct 18, 2025 version files 42.36 KB
-
Covscript-Figure5.R
5.10 KB
-
JBEscript-Figure4.R
10.10 KB
-
JBEscript-Figure4.RData
11.08 KB
-
README.md
6.75 KB
-
unimodal_and_linear_regression-Figure3.csv
3.20 KB
-
unimodal_and_linear_regression-Figure3.R
6.13 KB
Oct 22, 2025 version files 56.17 KB
-
abun.csv
9.51 KB
-
bio.csv
11.54 KB
-
Covscript-Figure5.R
5.17 KB
-
JBEscript-Figure4.R
10.19 KB
-
README.md
6.76 KB
-
unimodal_and_linear_regression_Figure3.csv
3.20 KB
-
unimodal_and_linear_regression_Figure3.R
6.14 KB
-
var.csv
3.67 KB
Abstract
Understanding the productivity–diversity relationship is central in ecology. While hypotheses exist for explaining positive and negative monotonic trends, they never have been combined into one model to account for hump-shaped patterns. Here, we propose a unified model integrating the more-individuals, biomass-driven competition, and environmental filtering hypotheses. Analyzing fish communities along a eutrophication gradient, we reconstructed the observed hump-shaped curve between productivity and species richness. Two productivity-related variables explained richness: community size (positive effect) and zooplanktivorous fish biomass (negative effect). Zooplanktivores, overly favored by high productivity, likely competed with juvenile stages of other species for zooplankton, leading to species exclusions. This offers rare evidence for intensified species interactions along a productivity gradient in animal communities. Competition-driven loss thus precedes stress-induced losses (e.g., hypoxia), offering potential for early-warning protocols to monitor eutrophication.
Dataset DOI: 10.5061/dryad.pg4f4qs1r
Description of the data and file structure
README — Unimodal, JBE, Covariance Analyses (Figures 3–5)
This repository contains scripts and data required to reproduce Figures 3–5 from the manuscript. The analyses cover:
- Unimodal and linear regression of fish community metrics versus environmental and productivity predictors (Figure 3).
- Nested regression modeling of productivity–richness relationships (Figure 4).
- Covariance tests across biomass gradients for different fish functional groups (Figure 5).
1. Figure 3 — Unimodal and Linear Regression
Script: unimodal_and_linear_regression_Figure3.R
Description:
Generates Figure 3 and supporting appendix figures, exploring linear vs. quadratic (unimodal) relationships between fish community metrics and predictors.
Input:
- unimodal_and_linear_regression_Figure3.csv — dataset containing lake-level observations.
Dataset columns:
| Column | Description | Transformation |
|---|---|---|
| No | Lake/sample ID | – |
| lake | Lake code | – |
| Chla | Chlorophyll a | log-transformed |
| SRic | Fish species richness | log-transformed |
| pielou | Species evenness | log-transformed |
| NPUE | Abundance per unit effort | log-transformed |
| BPUE | Biomass per unit effort | log-transformed |
| LogP | Proxy for productivity | Calculated: log(Productivity) = 0.91 * log(BPUE) - 0.38 * log(W), W = BPUE / NPUE |
How to use:
- Load the R script into R.
- Run the script from top to bottom.
- The script fits linear and quadratic models, calculates unimodal peaks, compares models (AIC, ANOVA), and generates scatter plots with regression curves.
- Produces Figure 3 and appendix plots.
Output:
Plots are generated for the following relationships:
| Response | Predictor | Description |
|---|---|---|
| Species Richness (SRic) | Log Productivity (LogP) | Linear & quadratic, peak indicated |
| SRic | Biomass (BPUE) | Linear & quadratic |
| SRic | Abundance (NPUE) | Linear & quadratic |
| SRic | Chlorophyll a (Chla) | Linear & quadratic |
| Evenness (pielou) | Log Productivity (LogP) | Linear & quadratic |
Each model comparison outputs:
- AIC values for linear vs. quadratic models
- ANOVA test between models
- Plots showing best-fitting curves and peak indicators
2. Figure 4 — JBE Models
Script: JBEscript-Figure4.R
Description:
Reproduces Figure 4 by comparing observed productivity–richness relationships with predictions from nested regression models (JBE, JB, JE, J, B, E). Computes RMSE for quantitative comparison and generates publication-ready figures.
Input:
This script requires three data files in CSV format:
- abun — fish abundance matrix
- Row names: lake codes.
- First column No: lake/sample identifier.
- Remaining columns: species abbreviations.
- Units: individuals (ind).
- bio — fish biomass matrix
- Row names: lake codes.
- First column No: lake/sample identifier.
- Remaining columns: species Latin names.
- Units: grams (g).
- var — environmental & community summary variables (data frame with lake rows). Important columns:
- No — lake/sample identifier (numeric)
- SRic — species richness (mean species count per lake/station)
- LogP — proxy for productivity, calculated as
log(Productivity) = 0.91 * log(BPUE) - 0.38 * log(W)
where W = BPUE / NPUE - TP — total phosphorus (mg L⁻¹)
- TN — total nitrogen (mg L⁻¹)
- Chla — chlorophyll a (µg L⁻¹)
- COD — chemical oxygen demand (permanganate-oxalate titration; mg L⁻¹)
- SD — Secchi depth (m)
- depth — maximum water depth (m)
- sup — lake area (km²)
Script overview:
- Import the three CSV files (abun.csv, bio.csv, var.csv)..
- Build full (lmnbe) and selected (bmnbe) regression models.
- Generate partial predictions under six scenarios (JBE, JB, JE, J, B, E).
- Calculate RMSE for model evaluation.
- Produce Figure 4, showing observed vs. predicted relationships.
How to run:
source("JBEscript-Figure4.R")
Set mod <- lmnbe or mod <- bmnbe in the script to reproduce full or selected model.
Output:
- Figure 4 (observed vs. predicted productivity–richness curves)
- RMSE values.
3. Figure 5 — Covariance Test across Biomass Gradients
Script: Covscript-Figure5.R
Description:
Calculates the covariance test (U, W, p) for different fish biomass groups (all species, zooplanktivores, piscivores, stocked species) across low, medium, and high lake biomass groups. Visualizes the results using ggplot2.
Input:
- The same three CSV data files (abun.csv, bio.csv, var.csv) as used in Figure 4.
Script overview:
- Define biomass groups and compute total biomass per functional group.
- Define the tcov function to compute U, W, and p for covariance tests.
- Rank lakes by biomass and split into low, medium, high groups.
- Compute covariance statistics for all functional groups and biomass classes.
- Prepare results for plotting (covtest) with significance labels.
- Generate Figure 5 using ggplot2.
Output:
- Figure 5: U-values of covariance test across biomass gradients, with significance annotations.
This unified README provides a concise description of the three main scripts, their inputs, outputs, and usage instructions, maintaining consistent style across all analyses.
Changes after Oct 18, 2025:
This version includes minor file format and naming updates to improve reproducibility and data integrity. No data values or code logic have been changed.
- The previous file
JBEscript-Figure4.RDatahas been replaced with three equivalent CSV files —abun.csv,bio.csv, andvar.csv. These files contain exactly the same data as the original.RDataobject but are stored in a more stable, plain-text format. - The file
unimodal and linear regression-Figure3.csvandunimodal and linear regression-Figure3.Rwere renamed tounimodal_and_linear_regression_Figure3.csvandunimodal_and_linear_regression_Figure3.Rto ensure consistent naming and prevent file path mismatches. The data and scripts content remains unchanged. - All R scripts were updated only in their data import sections to reflect the new file names and formats. No analytical or computational code was modified.
- The README file was updated accordingly to document these changes and improve clarity.
