View source: R/drake_plan_helpers.R
cancel_if | R Documentation |
Cancel a target mid-build if some logical condition is met.
Upon cancellation, drake
halts the current target and moves to the
next one. The target's previous value and metadata, if they exist,
remain in the cache.
cancel_if(condition, allow_missing = TRUE)
condition |
Logical, whether to cancel the target. |
allow_missing |
Logical. If |
Nothing.
cancel
## Not run:
isolate_example("cancel_if()", {
f <- function(x) {
cancel_if(x > 1)
Sys.sleep(2) # Does not run if x > 1.
}
g <- function(x) f(x)
plan <- drake_plan(y = g(2))
make(plan)
# Does not exist.
# readd(y)
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.