wlandau / targets-four-minutes

Get started with the {targets} R package in four minutes

Home Page:https://vimeo.com/700982360

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get started with targets in 4 minutes

cloud

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: the airquality dataset from the datasets package.
  • R/functions.R: custom R functions you define for the analysis.
  • _targets.R: a special script to configure and define the pipeline.

Usage

  1. install.packages("targets") to install the package.
  2. tar_manifest() and tar_visnetwork() to check the pipeline for correctness.
  3. tar_make() or similar to run the pipeline.
  4. 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 rerun tar_make(). All the targets will rerun.
  • Change only the plot_model() function in R/function.R and then rerun tar_make(). Only the plot target will rerun, and the rest will be skipped.

About

Get started with the {targets} R package in four minutes

https://vimeo.com/700982360

License:Other


Languages

Language:R 100.0%