Learn R Programming

targets (version 0.0.0.9000)

tar_pipeline: Declare a pipeline of targets.

Description

A pipeline is similar to a Makefile or a drake plan. It is a collection of targets, or skippable steps, in an automated reproducible workflow.

Usage

tar_pipeline(...)

Arguments

...

Targets or lists of targets defined with tar_target().

Value

A pipeline object. The _targets.R file of a project must end with a call tar_pipeline(). Otherwise, users do not work pipeline objects directly.

Examples

Run this code
# NOT RUN {
file <- tar_target(data_file, "data.csv", format = "file")
object <- tar_target(data_object, read.csv(data_file))
analysis <- tar_target(analysis, analyze(data_object))
pipeline <- tar_pipeline(file, object, analysis)
print(pipeline)
# Equivalent:
target_list <- list(
  tar_target(data_file, "data.csv", format = "file"),
  tar_target(data_object, read.csv(data_file)),
  tar_target(analysis, analyze(data_object))
)
pipeline <- tar_pipeline(target_list)
# }

Run the code above in your browser using DataLab