Acknowledgements

People

  • Dr John Broster
  • Dr Leon Hodgdson
  • A/Prof Fran Lopez-Ruiz
  • Dr Mechelle Owen
  • Prof Chris Preston
  • Dr Michael Widderick

Analytics for the Australian Grains Industry (AAGI) logo.

GRDC, Charles Sturt University, The University of Western Australia, Queensland DPI, Adelaide University an Centre for Crop and Disease Management logos.

Analytics for the Australian Grains Industry (AAGI) strategic partners, Grains Research and Development Corporation, Adelaide University, Curtin University and the University of Queensland logos.

The Problem is not the Map

Surveillance and monitoring applications begin with sensitive, messy and changing data.

  • Exact sampling locations can identify growers or properties
  • Classification rules evolve
  • New pesticide classes and pathosystems arrive
  • A useful application must remain fast and maintainable

Note

The challenge is to design the whole data product, not just the interface.

From PRIM to PRIM 2.0

This is not a presentation about why R is better than Python

  • 2024: a single-purpose product built with Python and Google Earth Engine
  • PRIM 2.0: rebuilt as an R platform with a reproducible pipeline and structured Shiny application
  • Design shift: move decisions upstream, then give the application only what it needs

A dashboard is the final layer of a data system, not the system itself.

One Architecture, Two Responsibilities

Pipeline

{targets} orchestrates a reproducible sequence:

ingest → validate → standardise → classify → summarise → export

The pipeline owns sensitive data, spatial transformations and business rules.

One Architecture, Two Responsibilities

Application

{golem} structures the Shiny product around app-ready objects.

{qs2} · {data.table} · {mapgl} · {echarts4r}

The application owns interaction, presentation and exploration.

The Pipeline is the Privacy Boundary

  1. Process GPS-derived coordinates locally
  2. Convert records to de-identified hexagonal bins
  3. Retain one geometry representation
  4. Export only app-ready summaries
  5. Keep sensitive locations and project identifiers off the web server

A Deliberately Small Application Contract

# Conceptual structure, not production code
list(
  map_data = resistance_by_hex,
  trend_data = resistance_over_time,
  filters = valid_filter_values,
  metadata = publication_safe_metadata
)

Faster

Less transformation during a user session.

Smaller

Lightweight serialised objects and one geometry.

Safer

No raw coordinates or project identifiers in deployment data.

The Extensibility Test

1. Add rule

A new fungicide resistance threshold is defined upstream.

2. Re-run pipeline

Classification and summaries are regenerated.

3. Open application

The result appears through the existing data model.

No app-code change

No new map filter or user control was required.

Extensibility is demonstrated when a new scientific rule changes data, not interface plumbing.

What Made the Design Work

Principles

  • Separate computation from presentation
  • Treat privacy as a pipeline property
  • Standardise data before UI logic
  • Use shared models across pesticide classes
  • Build modules around user tasks, not datasets

What Made the Design Work

Supporting tools

  • {targets} for dependency-aware pipelines
  • {golem} for a structured Shiny application
  • {data.table} for fast joins
  • {qs2} for compact, fast-loading objects
  • {mapgl} and {echarts4r} for responsive exploration
  • make for automating the pipeline and building and testing the R app and Docker container

Trade-offs and Lessons

  • More up-front design: schemas and boundaries must be explicit
  • Pipeline outputs become an API: changes require care and tests
  • Spatial aggregation reduces precision: privacy and interpretation must be balanced
  • Precomputation limits ad hoc analysis: that is often desirable in a public-facing product
  • Shared components need discipline: reuse works only when models remain genuinely common

Trade-offs and Lessons

The aim is not maximum flexibility. It is controlled, testable flexibility.

The Broader Lesson for R Developers

Careful pipeline design can make Shiny applications

faster · smaller · safer · easier to extend

Thank You

Professor Adam Sparks

Centre for Crop and Disease Management, Curtin University

Statistics · epidemiology · geospatial analysis · open-source R software

https://prim.ccdm.com/au

https://adamhsparks.codefloe.page/r_exchange_perth_2026/