A simple wrapper around targets::tar_read()
. This function reads the value
of a target from a completed or running tarflowr pipeline and returns it as
an object. This is generally preferred over tarflowr_load()
for
programmatic access.
Examples
if (FALSE) { # \dontrun{
td <- file.path(tempdir(), "_my_project")
tarflowr_run(
work_units = list(a = 1, b = 2),
process_func = function(x) x * 10,
combine_func = function(x) sum(unlist(x)),
project_dir = td
)
# inspect the processed work units
punits <- tarflowr_read(processed_unit, project_dir = td)
punits
# inspect the final result
res <- tarflowr_read(my_project_result, project_dir = td)
res
} # }