Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wlandau/targets-four-minutes
Get started with the {targets} R package in four minutes
https://github.com/wlandau/targets-four-minutes
make pipeline reproducibility rstats targets
Last synced: 17 days ago
JSON representation
Get started with the {targets} R package in four minutes
- Host: GitHub
- URL: https://github.com/wlandau/targets-four-minutes
- Owner: wlandau
- License: other
- Created: 2022-04-22T15:15:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-29T14:04:03.000Z (6 months ago)
- Last Synced: 2024-10-11T18:25:05.677Z (about 1 month ago)
- Topics: make, pipeline, reproducibility, rstats, targets
- Language: R
- Homepage: https://vimeo.com/700982360
- Size: 135 KB
- Stars: 36
- Watchers: 3
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - wlandau/targets-four-minutes - Get started with the {targets} R package in four minutes (R)
README
# Get started with `targets` in 4 minutes
[![cloud](https://img.shields.io/badge/RStudio-Cloud-blue)](https://rstudio.cloud/project/3946303)
The [`targets`](https://docs.ropensci.org/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`](https://docs.ropensci.org/targets/). It also comes up in the [walkthrough](https://books.ropensci.org/targets/walkthrough.html)
and [functions](https://books.ropensci.org/targets/functions.html)
chapters of the [user manual](https://books.ropensci.org/targets/).[![](./images/video.png)](https://vimeo.com/700982360)
## Try it out
Visit 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. `library(targets)` to load the package.
1. [`tar_manifest()`](https://docs.ropensci.org/targets/reference/tar_manifest.html) and [`tar_visnetwork()`](https://docs.ropensci.org/targets/reference/tar_visnetwork.html) to check the pipeline for correctness.
1. [`tar_make()`](https://docs.ropensci.org/targets/reference/tar_make.html) or [similar](https://docs.ropensci.org/targets/reference/index.html#pipeline) to run the pipeline.
1. [`tar_read()`](https://docs.ropensci.org/targets/reference/tar_read.html) to read target output.## Changes
* Rerun [`tar_make()`](https://docs.ropensci.org/targets/reference/tar_make.html) after changing nothing else. All targets will be skipped.
* Change the contents of `data.csv` and then rerun [`tar_make()`](https://docs.ropensci.org/targets/reference/tar_make.html). All the targets will rerun.
* Change only the `plot_model()` function in `R/function.R` and then rerun [`tar_make()`](https://docs.ropensci.org/targets/reference/tar_make.html). Only the `plot` target will rerun, and the rest will be skipped.