An R package for seasonal climate & crop yields

Understand the season.
Model the yield.

Interpretable regional models that connect monthly weather to crop yield, compare methods chronologically, and explain their predictions.

R ≥ 4.2 · Standard-library model estimation · MIT code

Observed data · reproducible comparisonBarley evaluation RMSE: hierarchical modelling has the lowest provincial and national RMSE.

Eight estimators. The same evaluation years.
Every score comes from the bundled Poland example.

From weather panels
to interpretable results.

A complete statistical workflow: data preparation, model tuning, rolling evaluation, fitting, prediction, and result export.

01

Respect time

Preprocessing and coefficients use earlier years at every forecast origin. Tune on an earlier block, then evaluate the procedure on later years.

02

Represent seasonal response

Compare pooled and regional effects, smooth monthly coefficients, asymmetric weather anomalies, and compound hot–dry interactions.

03

Inspect the prediction

Break a stress-lag prediction into additive components. Diagnose weather extrapolation, empirical intervals, and regional errors.

A compact R interface

Start with a panel.
Keep the evidence.

Use bundled inputs or provide your own region/year panel. A comparison object retains tuning candidates, selected settings, row-level predictions, model objects, and diagnostics.

Explore the function reference →
install.packages("remotes")
remotes::install_github("MR-Eini/yieldlag",
                        ref = "v0.3.0")
library(yieldlag)

data <- read_crop_data(
  poland_example_path(), "barley", 6
)
config <- crop_model_config(
  stress_temperature = "MAX",
  stress_precipitation = "PCP"
)
result <- compare_crop_models(
  data, config, 2018, 2019
)

A Poland example
you can inspect.

Barley and wheat across 16 provinces. Explore predictions, evaluation metrics, seasonal coefficients, regional differences, and the exported tables.

16Polish provinces
84Monthly weather terms per crop
8Methods compared
112Evaluation province-years per crop
These are retrospective benchmarks using complete seasonal weather and fixed area weights. They measure statistical associations and predictive performance in this dataset; they do not establish causal crop responses or operational early-forecast skill.