Data and code from: Soybean aphid (Hemiptera: Aphididae) population dynamics are associated with the temporal scale and pattern of soil moisture in soybean fields
Data files
Jul 28, 2026 version files 20.55 MB
-
Aphid_soil_Dryad.zip
20.54 MB
-
README.md
4.31 KB
Abstract
Understanding and predicting pest outbreaks is central to sustainable crop management, yet field evidence linking belowground abiotic conditions to aboveground herbivore dynamics remains limited, particularly across the temporal scales relevant to plant physiological responses. This dataset provides high-temporal-resolution soil environmental measurements and field observations of soybean aphid (Aphis glycines Matsumura) abundance collected in a soybean field in Taiwan over two growing seasons. Using an Internet of Things sensor network, soil moisture and soil electrical conductivity (EC) were monitored continuously, while soybean aphid abundance was sampled weekly. The dataset was used to evaluate associations between soybean aphid abundance and soil conditions summarized across multiple temporal windows, ranging from same-day values to 7-d rolling averages. R scripts are provided for data processing, statistical analyses, model evaluation, and figure generation. After accounting for seasonal progression and plant ontogeny, soil moisture showed more consistent, although generally weak, associations with soybean aphid abundance than soil EC. Short-term moisture metrics, particularly daily to 3-d averages, showed the most consistent positive associations, whereas associations over longer integration periods were weaker and more season-dependent. Predictive analyses showed that moisture-based models generally performed better in cross-validation than EC-only models, while adding EC provided limited improvement beyond soil moisture alone. Because the study was observational and conducted at a single field site, these results represent conditional field associations rather than direct evidence of causation. This dataset and accompanying R code provide a reproducible resource for investigating how the temporal scale of soil environmental measurements influences inference about soybean aphid–soil associations and for evaluating the use of high-frequency soil sensing in agricultural pest monitoring.
Reproducible code and data for the Aphid Soil Paper
This repository contains the data and R scripts required to reproduce every analysis, figure, and table reported in the main manuscript and Supplementary Information for: Soybean aphid (Hemiptera: Aphididae) population dynamics are associated with the temporal scale and pattern of soil moisture in soybean fields
The package reproduces the submitted analytical workflow without changing the analysis unit, resampling method, model definitions, numerical results, or conclusions.
Quick start
From the package root, run:
Rscript 00_run_all.R
The command creates results/figures/, results/tables/, and results/intermediate/. Generated results are intentionally not included in the archived package.
Each figure or table script can also be run independently, for example:
Rscript scripts/main_figures/Fig04_soil_moisture_correlations.R
Rscript scripts/main_tables/Table01_cross_validation_performance.R
All paths are package-relative, so scripts may be launched from any working directory.
Data files
data/aphid_soil_analysis_2024.csv
Analysis-ready data used for all soybean aphid analyses. It contains 822 observation-level records: 390 from the 2024 spring growing season and 432 from the 2024 fall growing season. Only variables read by the published figure and table scripts are included.
data/soil_microclimate_2024.csv
Daily soil-sensor summaries used to reproduce Fig. 2. It contains 2,004 daily field-plot records from the two 2024 growing seasons. Only the date, season, field-plot identifier, soil moisture, and soil electrical conductivity variables required by Fig. 2 are included.
data/data_dictionary.csv
Definitions, units, derivations, data types, and manuscript uses for every released variable.
Blank cells in the CSV files represent missing values. Dates use ISO format (YYYY-MM-DD).
Figure 1 source artwork
The Fig. 1 field-plot and sampling-design artwork is stored in figure_assets/. The available project archive did not contain its original vector drawing or a spatial-layout table. Therefore, Fig01_field_design.R copies the documented source artwork and does not claim analytical regeneration. All other figures and tables are generated directly from the released CSV files.
Script organization
scripts/functions/analysis_and_figure_functions.R: shared data import, transformation, correlation, bootstrap, prediction, model-selection, and plotting functions.scripts/main_figures/: one script for each main-text figure, Fig. 1 through Fig. 8.scripts/main_tables/: the main-text 10-fold cross-validation table.scripts/supplementary/: Table S1 and Figs. S1-S10.
Analytical workflow reproduced
- Observation-level dataset with 822 records.
- Pearson correlations and associated P values.
- Observation-level bootstrap resampling with 2,000 replicates (
set.seed(125)). - Random 10-fold cross-validation for the moisture, EC, and moisture + EC prediction models (
set.seed(125)). - Exploratory stepwise-AIC selection-frequency analysis (
set.seed(123)). - Four-model AICc comparison.
- Main-text Figs. 1-8 and Table 1.
- Supplementary Figs. S1-S10 and Table S1.
Software requirements
The final verification run used R 4.5.1 and the package versions recorded in sessionInfo.txt. Required packages are dplyr, tidyr, ggplot2, cowplot, purrr, stringr, forcats, scales, boot, MASS, glmmTMB, DHARMa, and broom.
For an environment close to the verified run, install renv and restore the recorded package versions:
install.packages("renv")
renv::restore()
Alternatively, install the required packages normally and run Rscript 00_run_all.R.
Reproducibility notes
- The diagnostic model in Fig. S1 may emit version or convergence warnings from
glmmTMB/DHARMawhile still completing and producing the reported diagnostic figure. - The scripts create a local font cache under
results/.cache/to avoid system-specific font-cache write errors. - No script reads a previously generated result as an analytical input.
