Learn R Programming

targets (version 0.0.0.9000)

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

Description

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

Usage

tar_cancel(condition = TRUE)

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.

Examples

Run this code
# NOT RUN {
refresh_data_on_mondays <- function() {
  tar_cancel(!is_monday())
}
x <- tar_target(x, refresh_data_on_mondays())
# }

Run the code above in your browser using DataLab