create_task_step: Create an object that defines a step within a task

Description Usage Arguments Examples

View source: R/create_task_step.R

Description

The default values of each parameter are often acceptable, but all parameters may be overridden. When constructing the task makefile or table, the target_name, depends, and command elements are built in that order, with each element optionally depending on the result of the previous elements. They can also depend on the step_name (defined in this function call) and/or the task_name (to be listed in a call to create_task_plan(), where the definitions declared here will ultimately be evaluated)

Usage

1
2
3
4
5
6
7
8
create_task_step(
  step_name,
  target_name = function(task_name, step_name, ...) {     sprintf("%s_%s", task_name,
    step_name) },
  depends = character(0),
  command = function(task_name, step_name, ...) {     sprintf("%s(I('%s'))",
    step_name, task_name) }
)

Arguments

step_name

a single character string naming this step. The default target_name combines this step_name with the task_name, and the default command assumes this step_name is the function name, but both defaults may be overridden (see next arguments)

target_name

a character string or vector, or a function that produces a character string or vector, giving a unique name for the remake target for a specific application of this step to a specific task. If a function, should accept ... and other args optionally including task_name and step_name

depends

a character string or vector, or a function that produces a character string or vector, defining any dependencies that need to be declared in addition to those implied by command. If a function, should accept ... and other args optionally including task_name, step_name, and target_name

command

a character string or vector, or a function that produces a character string or vector, defining the command to be run for each application of this step to a specific task. If a function, should accept ... and other args optionally including task_name, step_name, target_name, and depends

Examples

1
2
3
4
5
6
7
create_task_step(
  'plot',
  target_name=function(task_name, step_name, ...) {
    sprintf('~/MyProjects/thisproject/%s_%s.png', task_name, step_name)
  },
  command='plot_site(target_name)'
)

aappling-usgs/scipiper documentation built on Aug. 1, 2020, 3:11 p.m.