Awesome
Get started with targets
in 4 minutes
The targets
R package is a pipeline tool for reproducible computation in statistics and data science. This short example is the one from the 4-minute video on getting started with targets
. It also comes up in the walkthrough
and functions
chapters of the user manual.
Try it out
Visit https://rstudio.cloud/project/3946303 to try out the code in a web browser. No download or installation required.
Files
data.csv
: theairquality
dataset from thedatasets
package.R/functions.R
: custom R functions you define for the analysis._targets.R
: a special script to configure and define the pipeline.
Usage
library(targets)
to load the package.tar_manifest()
andtar_visnetwork()
to check the pipeline for correctness.tar_make()
or similar to run the pipeline.tar_read()
to read target output.
Changes
- Rerun
tar_make()
after changing nothing else. All targets will be skipped. - Change the contents of
data.csv
and then reruntar_make()
. All the targets will rerun. - Change only the
plot_model()
function inR/function.R
and then reruntar_make()
. Only theplot
target will rerun, and the rest will be skipped.