Skip to contents

A simple wrapper around targets::tar_load(). This function loads the value of a target from a completed or running tarflowr pipeline into the specified R environment.

Usage

tarflowr_load(name, project_dir, envir = parent.frame())

Arguments

name

The unquoted name of the target to load.

project_dir

The path to the tarflowr project directory containing _targets/objects folder to load from.

envir

The environment to load the target into. Defaults to the calling environment (parent.frame())

Value

The object name is loaded into the specified environment envir as a side-effect.

Author

Andrew G. Brown

Examples

if (FALSE) { # \dontrun{

td <- file.path(tempdir(), "_my_project")

res <- tarflowr_run(
  work_units = list(a = 1, b = 2),
  process_func = function(x) x * 10,
  project_dir = td
)

# load target object into current environment as side-effect
tarflowr_load(work_seq, project_dir = td)

work_seq
} # }