Agronomists and students need quick, transparent ways to explore how rainfall and soil type affect yield.
```{r} crop_base <- c(Sorghum = 1200, Maize = 1500, Barley = 1000) soil_bonus <- c(Sandy = -150, Loam = 100, Clay = 50) beta_rain <- c(Sorghum = 0.8, Maize = 1.0, Barley = 0.6)
predict_yield <- function(crop=“Sorghum”, soil=“Loam”, rain=750) { round(crop_base[[crop]] + soil_bonus[[soil]] + beta_rain[[crop]] * rain, 0) }
predict_yield(“Sorghum”, “Loam”, 750)
gh-pages
branch.✅ This satisfies your assignment’s requirement: 5 slides, embedded R code, hosted online.