Simple Crop Yield Predictor

Hewan Demissie Degu

The Problem

Agronomists and students need quick, transparent ways to explore how rainfall and soil type affect yield.

The Solution

  • Interactive Shiny app
  • User selects crop, soil, rainfall
  • App returns yield estimate + plot

Demo (with R code)

```{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)

🟢 Step 3. Render your slides

  • In RStudio, click the Render button (blue arrow at the top).
  • This will generate an HTML slide deck you can step through in your browser.

🟢 Step 4. Publish

  • You can publish Quarto presentations to RPubs (via RStudio’s Publish button) or to GitHub Pages.
  • For RPubs: click Publish in RStudio → choose RPubs → copy the link.
  • For GitHub Pages: push the rendered HTML to a gh-pages branch.

✅ This satisfies your assignment’s requirement: 5 slides, embedded R code, hosted online.