Introduction to targets and geotargets

Author

Nicholas Tierney

Published

February 17, 2026

1 Welcome

Welcome to targets and geotargets! This course will teach you how to build reproducible computational pipelines for data analysis and geospatial workflows.

2 Course Materials

Materials will be added here as we progress through the course.

https://gentle-targets.njtierney.com

Prerequisites

  • Experience writing basic R scripts
  • Familiarity with writing functions in R
  • Experience with spatial data packages (terra, sf) helpful but not required
  • Experience in writing your own data analysis

Learning outcomes

  • Understand benefits of using a pipeline approach like {targets}
  • How to write functions that work in a pipeline
  • How to debug common pipeline issues
  • How to use {targets} with {geotargets}

3 Schedule

3.1 Why Pipelines?

  • Where do I start? What do I run first?
  • Common problems with pipelines/workflows
  • Intro to {targets}
  • Concepts in {targets}: functions, targets, graphs/networks
  • Where we are going

3.2 Starting with function: writing out a workflow

  • Defining out functions as the unit of understanding
  • Ideal properties of functions
  • Properties to avoid in functions
  • Writing out a workflow with functions
  • Using {fnmate} to accelerate function creation

3.3 Debugging functions

  • brower()
  • debug() and debugonce()
  • options(recover)

3.4 Getting started with {targets}

  • Using {tflow} to set up a targets project
    • Unpacking folder structure, _targets.R file
    • Using functions for pipeline steps
    • Using tar_assign()
  • Your first pipeline
  • Modifying and rebuilding: understanding what changes

3.5 Deeper workflow with {targets}

  • Data read in with tar_read()
  • Rendering reports with tar_quarto()
  • Using keyboard shortcuts to load, inspect
  • Using tar_workspaces() to debug issues
  • Common problems when writing pipelines

3.6 Advanced Targets Features

  • Using {crew} to paralellise workflow
  • Branching
  • Using targets with HPC

3.7 Introduction to Geospatial Data

  • Spatial data challenges
  • Introduction to {terra} and {sf}

3.8 Geospatial Pipelines with {geotargets}

  • Why {geotargets}?
  • tar_terra_rast(), tar_terra_vect(), etc
  • Building a geospatial pipeline

3.9 Production Workflows and Best Practices

  • Organising large projects
  • Convert your own work into a pipeline
  • Feedback on your pipeline
  • Resources and next steps
  • Open Q&A