Building reproducible workflows with {targets}

Author
Affiliation

Georgia State University

Workshop date

February 17, 2026

Overview

Have you ever created files named “01_clean.R”, “02_analysis.R”, and “03_plots.R” and forgotten to run one of the files in the right order? Have you had to manually rerun an entire analysis after a single input changes—even if that input only affected one plot? Data analysis involves many moving parts. Traditional script-based approaches often lead to fragile pipelines, wasted computation, and reproducibility nightmares. Fortunately, the {targets} package for R offers a powerful solution by implementing a Make-like pipeline toolkit that transforms chaotic scripts into streamlined, automated workflows that intelligently skip unnecessary steps.

Materials

All the materials we’ll use today are three self-contained RStudio projects:

Packages

You’ll need all these packages on your computer if you’re following along:

install.packages(
  c("tidyverse", "ggrepel", "sf", "tigris", "dataverse", "jsonlite", 
    "targets", "tarchetypes", "tidybayes", "brms",
    "marginaleffects", "modelsummary", "parameters", "patchwork"
  )
)

Slides

Other examples and resources

Official documentation

Pipelines for research projects

Pipelines for course websites

  • Data Visualization with R
    (pipeline builds data, zips project folders, converts HTML slides to PDF, builds Quarto website, and uploads everything to a server)
    Website and _targets.R

  • Program Evaluation for Public Service
    (pipeline builds data, zips project folders, converts HTML slides to PDF, builds Quarto website, and uploads everything to a server)
    Website and _targets.R

  • Governance Around the World
    (pipeline builds Quarto website and uploads everything to a server)
    Website and _targets.R

Pipelines for Idaho’s 2024 election