stageRunner objects are used for executing a linear sequence of actions on a context (an environment). For example, if we have an environment e containing x = 1, y = 2, then using stages = list(function(e) e$x <- e$x + 1, function(e) e$y <- e$y - e$x) will cause x = 2, y = 0 after running the stages.

stagerunner_initialize(context, stages, remember = FALSE,
  mode = getOption("stagerunner.mode") %||% "head")

Arguments

context

environment. The initial environment that is getting modified during the execution of the stages.

stages

list. The functions to execute on the context.

remember

logical. Whether to keep a copy of the context and its contents throughout each stage for debugging purposes--this makes it easy to go back and investigate a stage.

The default is FALSE. When set to TRUE, the return value of the run method will be a list of two environments: one of what the context looked like before the run call, and another of the aftermath.

mode

character. Controls the default behavior of calling the run method for this stageRunner. The two supported options are "head" and "next". The former gives a stageRunner which always begins from the first stage if the from parameter to the run method is blank. Otherwise, it will begin from the previous unexecuted stage. The default is "head". This argument has no effect if remember = FALSE.