Skip to contents

This function is used in drakes init scripts _drake_single_sample.R and _drake_integration.R. It sources an R script (plan_custom.R by default) which must return a drake::drake_plan() object. In the R script, all variables defined in the init script are available, mainly cfg and cfg_pipeline lists holding pipeline parameters. At the same time, all those variables are locked and cannot be modified in file script.

Usage

load_custom_plan(
  file = getOption("scdrake_plan_custom_file"),
  envir = parent.frame()
)

Arguments

file

A character scalar: path to R script returning a drake::drake_plan().

envir

An environment in which the R script will be sourced (defaults to caller env).

Value

A drake::drake_plan() object (tibble).