A Gentle Introduction to Targets
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 workshop, 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 workshop, so you can understand the process and see how this could benefit your own work.
I have three goals in this workshop:
- To convince you {targets} is worth learning, and that you can use it
- For you to be able to start using {targets} after 45 minutes
- For you to feel more confident writing functions