A gentle guide to using the {targets} package for analytic pipelines
Data analysis is an iterative process. Data cleaning, exploratory data analysis (EDA), and model fitting are rarely run without a hitch from start to finish. Each step takes time, and often requires revisiting earlier steps to correct for newly discovered problems. For example, in performing EDA, you can unearth a text issue that requires revisiting data cleaning. When you are finally done with the analysis, you will need to reproduce it to check it all works as expected. To reproduce the analysis, there is a temptation to run the code again from the top, which may take a long time. You can save time by saving model outputs, but if you make a change to an earlier data cleaning step, you'll need to update everything that depends on that. You can write code to manage these dependencies, but this is a hard problem. Fortunately, "pipeline tools" are an existing approach to manage these dependencies. They take care of the details of watching which files and relevant code changes, and only run the necessary parts. The {targets} R package is one popular pipeline approach, providing extensive documentation and user support. However, it presents a different coding practice that might not be familiar. In this interactive walkthrough, I will gently introduce the ideas behind {targets}, and will live code a data analysis using {targets} from scratch, warts and all. I encourage questions throughout the live coding walkthrough, so you can understand the process and see how this could benefit your own work. A recording of this session is available on YouTube: https://youtu.be/N7kHznha_o0
Institutions
- Weatherford College (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2024-12-06
- DOI
- https://doi.org/10.5281/zenodo.14290311
- Primary Topic
- Species Distribution and Climate Change
- Type
- article
- Field-Weighted Citation Impact
- 0.00