Learn R Programming

drake (version 4.2.0)

plan: Function plan

Description

Turns a named collection of command/target pairs into a workflow plan data frame for make and check.

Usage

plan(..., list = character(0), file_targets = FALSE,
  strings_in_dots = c("filenames", "literals"))

Arguments

...

commands named by the targets they generate. Recall that drake uses single quotes to denote external files and double-quoted strings as ordinary strings. Use the strings_in_dots argument to control the quoting in ....

list

character vector of commands named by the targets they generate.

file_targets

logical. If TRUE, targets are single-quoted to tell drake that these are external files that should be expected as output in the next call to make().

strings_in_dots

character scalar. If "filenames", all character strings in ... will be treated as names of file dependencies (single-quoted). If "literals", all character strings in ... will be treated as ordinary strings, not dependencies of any sort (double-quoted). Because of R's automatic parsing/deparsing behavior, strings in ... cannot simply be left alone.

Value

data frame of targets and command

Details

A workflow plan data frame is a data frame with a target column and a command column. Targets are the objects and files that drake generates, and commands are the pieces of R code that produce them.

For file inputs and targets, drake uses single quotes. Double quotes are reserved for ordinary strings. The distinction is important because drake thinks about how files, objects, targets, etc. depend on each other. Quotes in the list argument are left alone, but R messes with quotes when it parses the freeform arguments in ..., so use the strings_in_dots argument to control the quoting in ....

See Also

link{check}, make,

Examples

Run this code
# NOT RUN {
plan(small = simulate(5), large = simulate(50))
plan(list = c(x = "1 + 1", y = "sqrt(x)"))
plan(data = readRDS("my_data.rds"))
plan(my_file.rds = saveRDS(1+1, "my_file.rds"), file_targets = TRUE,
  strings_in_dots = "literals")
# }

Run the code above in your browser using DataLab