Adam Sparks

Curtin University | Professor 

Professor Adam Sparks is a Professor at Curtin University's Centre for Crop and Disease Management and leads agricultural data analytics initiatives. His work combines statistics, epidemiology, geospatial analysis, and software development to support data-driven decision making in agriculture. Adam develops open-source tools and reproducible workflows in R for analysing crop, climate, and disease surveillance data, with applications ranging from resistance monitoring to environmental risk assessment. He is an active contributor to the R ecosystem, with interests in package development, reproducible research, and scalable analytics pipelines that enable researchers and industry partners to translate complex data into practical insights.

Abstract

Building Privacy Preserving R Pipelines and Shiny Applications for Real World Surveillance

The Pesticide Resistance Integrated Mapping (PRIM) tool was originally launched in 2024 using Python and Google Earth Engine to display fungicide resistance surveillance data. PRIM 2.0 rebuilds that work as a privacy-preserving R platform for reproducible pipelines, structured Shiny development, and reliable deployment.

The second-generation platform combines {targets}, {golem}, and {Shiny} with fast loading {qs2} objects, {data.table} joins, {mapgl} maps, and {echarts4r} graphics to support responsive fungicide and herbicide surveillance workflows.

The core design separates data processing from application delivery: records are ingested, validated, standardised, classified against resistance thresholds, spatially summarised, and exported as lightweight app-ready data before Shiny consumes them.

This separation supports privacy and performance by processing GPS-derived coordinates locally, converting them to de-identified hexagonal bins, retaining a single geometry object, and ensuring sensitive locations and project identifiers do not leave the local computer for the web server.

The architecture was tested through staged expansion from herbicide resistance to integrated fungicide resistance data, showing how shared data models and interface components can support multiple pathosystems and pesticide classes.

As a practical extensibility test, a new fungicide threshold classification was added upstream in the pipeline and propagated to the final application without changing app code, map filters, or user-facing controls.

This case study discusses the design decisions, trade-offs, and lessons learned in moving from a single-purpose mapping product to a reusable R architecture that reduces maintenance burden, improves speed and application size, protects sensitive data, and provides a stronger foundation for future decision-support tools.

For R developers, the broader lesson is that careful pipeline design can make Shiny applications faster, smaller, safer, and easier to extend as data products mature.