Dynamic Function-Oriented Make-Like Declarative Pipelines (2024)

Dynamic Function-Oriented Make-Like Declarative Pipelines (1)

Dynamic Function-Oriented Make-Like Declarative Pipelines (2) Dynamic Function-Oriented Make-Like Declarative Pipelines (3) Dynamic Function-Oriented Make-Like Declarative Pipelines (4) Dynamic Function-Oriented Make-Like Declarative Pipelines (5) Dynamic Function-Oriented Make-Like Declarative Pipelines (6) Dynamic Function-Oriented Make-Like Declarative Pipelines (7) Dynamic Function-Oriented Make-Like Declarative Pipelines (8) Dynamic Function-Oriented Make-Like Declarative Pipelines (9) Dynamic Function-Oriented Make-Like Declarative Pipelines (10)

Pipeline tools coordinate the pieces of computationally demanding analysis projects. The targets package is a Make-like pipeline tool for statistics and data science in R. The package skips costly runtime for tasks that are already up to date, orchestrates the necessary computation with implicit parallel computing, and abstracts files as R objects. If all the current output matches the current upstream code and data, then the whole pipeline is up to date, and the results are more trustworthy than otherwise.

Philosophy

A pipeline is a computational workflow that does statistics, analytics, or data science. Examples include forecasting customer behavior, simulating a clinical trial, and detecting differential expression from genomics data. A pipeline contains tasks to prepare datasets, run models, and summarize results for a business deliverable or research paper. The methods behind these tasks are user-defined R functions that live in R scripts, ideally in a folder called "R/" in the project. The tasks themselves are called “targets”, and they run the functions and return R objects. The targets package orchestrates the targets and stores the output objects to make your pipeline efficient, painless, and reproducible.

Installation

If you are using targets with crew for distributed computing, it is recommended to use crew version 0.4.0 or higher.

There are multiple ways to install the targets package itself, and both the latest release and the development version are available.

TypeSourceCommand
ReleaseCRANinstall.packages("targets")
DevelopmentGitHubremotes::install_github("ropensci/targets")
DevelopmentrOpenSciinstall.packages("targets", repos = "https://dev.ropensci.org")

Get started in 4 minutes

The 4-minute video at https://vimeo.com/700982360 demonstrates the example pipeline used in the walkthrough and functions chapters of the user manual. Visit https://github.com/wlandau/targets-four-minutes for the code and https://rstudio.cloud/project/3946303 to try out the code in a browser (no download or installation required).

Dynamic Function-Oriented Make-Like Declarative Pipelines (11)

Usage

To create a pipeline of your own:

  1. Write R functions for a pipeline and save them to R scripts (ideally in the "R/" folder of your project).
  2. Call use_targets() to write key files, including the vital _targets.R file which configures and defines the pipeline.
  3. Follow the comments in _targets.R to fill in the details of your specific pipeline.
  4. Check the pipeline with tar_visnetwork(), run it with tar_make(), and read output with tar_read(). More functions are available.

Documentation

  • User manual: in-depth discussion about how to use targets. The most important chapters are the walkthrough, help guide, and debugging guide.
  • Reference website: formal documentation of all user-side functions, the statement of need, and multiple design documents of the internal architecture.
  • Developer documentation: software design documents for developers contributing to the deep internal architecture of targets.

Help

Please read the help guide to learn how best to ask for help using targets.

Selected talks

English

Español

Apps

  • tar_watch(): a built-in Shiny app to visualize progress while a pipeline is running. Available as a Shiny module via tar_watch_ui() and tar_watch_server().
  • targetsketch: a Shiny app to help sketch pipelines (app, source).

Deployment

Extending and customizing targets

  • R Targetopia: a collection of R packages that extend targets. These packages simplify pipeline construction for specific fields of Statistics and data science.
  • Target factories: a programming technique to write specialized interfaces for custom pipelines. Posts here and here describe how.

Code of conduct

Please note that this package is released with a Contributor Code of Conduct.

Citation

citation("targets")To cite targets in publications use: Landau, W. M., (2021). The targets R package: a dynamic Make-like function-oriented pipeline toolkit for reproducibility and high-performance computing. Journal of Open Source Software, 6(57), 2959, https://doi.org/10.21105/joss.02959A BibTeX entry for LaTeX users is @Article{, title = {The targets R package: a dynamic Make-like function-oriented pipeline toolkit for reproducibility and high-performance computing}, author = {William Michael Landau}, journal = {Journal of Open Source Software}, year = {2021}, volume = {6}, number = {57}, pages = {2959}, url = {https://doi.org/10.21105/joss.02959}, }
Dynamic Function-Oriented Make-Like Declarative Pipelines (2024)
Top Articles
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 6096

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.