try_again | R Documentation |
Try evaluating an expressing multiple times until it succeeds.
try_again(times, code)
times |
Maximum number of attempts. |
code |
Code to evaluate |
third_try <- local({
i <- 3
function() {
i <<- i - 1
if (i > 0) fail(paste0("i is ", i))
}
})
try_again(3, third_try())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.