Return TRUE if called in a target or _targets.R and
the pipeline is running.
Value
Logical of length 1, TRUE if called in a target or _targets.R
and the pipeline is running (FALSE otherwise).
See also
Other utilities:
tar_backoff(),
tar_call(),
tar_cancel(),
tar_definition(),
tar_described_as(),
tar_envir(),
tar_format_get(),
tar_group(),
tar_name(),
tar_path(),
tar_path_script(),
tar_path_script_support(),
tar_path_store(),
tar_path_target(),
tar_source(),
tar_store(),
tar_unblock_process()
Examples
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_active() # FALSE
tar_script({
library(targets)
library(tarchetypes)
message("Pipeline running? ", tar_active())
tar_target(x, tar_active())
})
tar_manifest() # prints "Pipeline running? FALSE"
tar_make() # prints "pipeline running? TRUE"
tar_read(x) # TRUE
})
}