Shiny optimization of climate benefits from a statewide agricultural grant program



Jadey Ryan
Leslie Michel & Dani Gelardi
Cascadia R Conf | August 19, 2023

Washington’s Sustainable Farms & Fields Program incentivizes climate-smart practices.


$1.8 million in FY23

$1.5 million in FY24




Photo: San Juan Island Conservation District

Benefits from climate-smart practices vary widely.

More than 50 soil samples taken from different agricultural fields across Washington State. Each sample has a different color and texture, showcasing how diverse soils are.

Photo: Molly McIlquham

We needed a decision-support tool to identify projects with the greatest climate benefits.

Models and tools for on-farm carbon and GHG accounting already exist.


COMET Farm website header that lists US Department of Agriculture Natural Resources Conservation Service and Colorado State University logos.

Too hard to use!

COMET Planner website header that lists US Department of Agriculture Natural Resources Conservation Service and Colorado State University logos.

Too limited!

Our wishlist 📑


User-friendly for grant applicants and the public


Interactively compare conservation practices


Convert CO2eq estimates into familiar terms


Downloadable spreadsheets and reports

Washington Climate Smart Estimator

Demo 🎥

Study Shiny 🤓📚

Start with examples and big picture workflows.

Screenshot of Posit's R Shiny Gallery.

Posit Shiny Gallery

Book cover of Mastering Shiny book by Hadley Wickham.

Mastering Shiny

Book cover of Engineering Production-Grade Shiny Apps by Colin Fay, Sébastien Rochette, Vincent Guyader, and Cervan Girard.

Engineering Production-Grade Shiny Apps

Wireframe Wishes ✍️ 🌟

Before coding, sketch data flows and app design.

Flowchart of data inputs, reactive expressions, and outputs.

Sketch of Shiny application layout for the Calculate Your Estimate tab.

Construct Code 🛠️ 💻

Prototype then refactor with custom functions.


fct_helpBtn <- function(id) {
  shinyWidgets::actionBttn(
    inputId = id,
    label = NULL,
    icon = icon("question"),
    style = "material-circle",
    size = "xs",
  )
}

Elevate Experience 💖 💃

Incorporate HTML, CSS, JavaScript to improve user experience.

shinyjs::runjs(
    "function onTimeout() {
        alert('Warning: Your session will time out in 3 minutes.');
      } ...")

shinydisconnect::disconnectMessage(
  text = "Your session timed out. Please refresh the page and try again.",
  refresh = "Refresh")

Default shiny message that says disconnected from the server. Reload. The rest of the Shiny app is greyed out.

WaCSE dialog box that warns the user the shinyapps.io session will time out in 3 minutes. Another dialog box that is nicely formatted that says Your session times out. Please refresh the page and try again.

Try a new R package or workflow to solve a problem!

There are many amazing R resources, and the community is incredibly supportive!

Jadey in waders setting up a transect with a measuring tape to measure flow in a small stream.

Jadey's cat, Mai, sitting on her laptop that has RStudio open. The monitor next to the laptop and cat has the R Packages book by Hadley Wickham and Jenny Bryan open.

I’d love to connect with you!