Learn R Programming

drake (version 6.1.0)

target: Define custom columns in a drake_plan().

Description

The target() function lets you define custom columns in a workflow plan data frame, both inside and outside calls to drake_plan(). @details Tidy evaluation is applied to the arguments, and the !! operator is evaluated immediately for expressions and language objects.

Usage

target(command = NULL, trigger = NULL, retries = NULL,
  timeout = NULL, cpu = NULL, elapsed = NULL, priority = NULL,
  worker = NULL, evaluator = NULL, ...)

Arguments

command

the command to build the target

trigger

the target's trigger

retries

number of retries in case of failure

timeout

overall timeout (in seconds) for building a target

cpu

cpu timeout (seconds) for building a target

elapsed

elapsed time (seconds) for building a target

priority

integer giving the build priority of a target. Given two targets about to be built at the same time, the one with the lesser priority (numerically speaking) will be built first.

worker

the preferred worker to be assigned the target (in parallel computing).

evaluator

the future evaluator of the target. Not yet supported.

...

named arguments specifying non-standard fields of the workflow plan.

Value

A one-row workflow plan data frame with the named arguments as columns.

See Also

drake_plan(), make()

Examples

Run this code
# NOT RUN {
# Use target() to create your own custom columns in a drake plan.
# See ?triggers for more on triggers.
plan <- drake_plan(
  website_data = target(
    download_data("www.your_url.com"),
    trigger = "always",
    custom_column = 5
  ),
  analysis = analyze(website_data),
  strings_in_dots = "literals"
)
plan
# make(plan) # nolint
# Call target() inside or outside drake_plan().
target(
  download_data("www.your_url.com"),
  trigger = "always",
  custom_column = 5
)
# }

Run the code above in your browser using DataLab