drake (version 6.2.1)

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().

Usage

target(command = NULL, trigger = NULL, retries = NULL,
  timeout = NULL, cpu = NULL, elapsed = NULL, priority = NULL,
  worker = NULL, resources = 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).

resources

Experimental, no guarantees that this works all the time. Same as the resources argument to batchtools_slurm() and related future.bachtools functions. See also https://github.com/HenrikBengtsson/future.batchtools#examples. # nolint resources is a list of computing resource parameters for the target. Each element is a value passed to a brew placeholder of a batchtools template file. The list names of resources should be the brew patterns.

...

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

Value

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

Details

Tidy evaluation is applied to the arguments, and the !! operator is evaluated immediately for expressions and language objects.

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