tar_cancel: Cancel a target mid-build under a custom condition.

Description Usage Arguments Details See Also Examples

View source: R/tar_cancel.R

Description

Cancel a target while its command is running if a condition is met.

Usage

1

Arguments

condition

Logical of length 1, whether to cancel the target.

Details

Must be invoked by the target itself. tar_cancel() cannot interrupt a target from another process.

See Also

Other utilities: tar_envir(), tar_group(), tar_name(), tar_path(), tar_seed()

Examples

1
2
3
4
5
6
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
tar_dir({ # tar_dir() runs code from a temporary directory.
tar_script(tar_target(x, tar_cancel(1 > 0)))
tar_make() # Should cancel target x.
})
}

targets documentation built on July 21, 2021, 5:07 p.m.