A Shiny app for spray drift prediction in agricultural risk assessment, using Bayesian multilevel regression models fitted with brms. A deliverable of the SETAC DRAW workshop.
The app predicts spray drift deposition at various downwind distances under user-specified environmental conditions and application settings, and compares predictions against Rautmann reference curves.
- Dashboard: Configure application settings (pressure, boom height, speed, rate), environmental conditions (wind speed, temperature, WBD/RH), and crop information to generate drift predictions with credible/prediction intervals.
- Trial Comparisons: Visualise how individual factors (boom height, WBD, wind speed, drop spectra, tractor speed) affect drift using example trial pairs from the DRAW database.
- Report Download: Generate an HTML report of the current prediction scenario.
- Model Selection: Choose between a Bayesian multilevel model (BRM-lognormal) or a frequentist linear mixed model (LME).
R ≥ 4.3 and the following packages:
install.packages(c(
"shiny", "bslib", "DT", "gridExtra",
"brms", "lme4", "nleqslv",
"dplyr", "tidyr", "ggplot2", "scales",
"rmarkdown", "knitr"
))The fitted model objects (~470 MB total) are hosted as a GitHub Release asset and are not included in the repository. They are downloaded automatically on first run, or you can download them manually:
# Automatic: just run the app - it will prompt to download
shiny::runApp()
# Manual: download from the latest GitHub Release
# Place files in program/data/shiny::runApp()├── app.R # Shiny app (UI + server)
├── functions.R # Domain logic: models, predictions, plots
├── report.Rmd # Downloadable HTML report template
└── program/
├── Documentation.html # About DRAW (rendered HTML)
├── Documentation.md # About DRAW (source)
├── Manual.md # User manual
└── data/
├── fit.STD.NoAngle.addTemp.rda # brms model (~460 MB, via Release)
├── mod.STD.NoAngle.addTemp.rda # lme4 model (~8 MB, via Release)
├── rautmann.rda # Rautmann reference curves
├── comparedat.rda # Pre-computed comparison trial data
└── ComparisonCases.csv # Comparison trial metadata
Spray drift can be defined as the quantity of plant protection product carried out of the sprayed area by air currents during application. The DRAW (Drift Risk Assessment Workshop) database assembled spray drift trials for boom sprayers from research institutions across the EU and North America.
The models use a Bayesian multilevel framework where each trial has its own intercept and slope for the log-distance relationship, with fixed effects for environmental covariates (wind speed, temperature, wet bulb depression, pressure, boom height, crop height, tractor speed).
For details, see the About DRAW tab in the app or the SETAC DRAW website.
This project is licensed under the GNU General Public License v3.0 (GPL-3) — see LICENSE for details.
The fitted model objects are derived from the SETAC DRAW database, which is subject to its own data sharing agreement. See the SETAC DRAW website for details.
- Ganzelmeier, H. and Rautmann, D. (2000). Drift, drift reducing sprayers and sprayer testing. Aspects of Applied Biology 57, Pesticide Application. (ResearchGate)
- Rautmann, D., Streloke, M. and Winkler, R. (2001). New basic drift values in the authorization procedure for plant protection products. Mitt. Biol. Bundesanst. Land- Forstwirtsch. 383, 133–141.
- JKI (2010). Spreadsheet 'Tabelle der Abdrifteckwerte.xls'. (no longer available).
If you use this app in your work, please cite the SETAC DRAW workshop and the associated publication.