View source: R/never_give_up.R
never_give_up | R Documentation |
Convenience wrapper to allow an expression to keep evaluating (until 10 attempts) until it completes without error, plays a sound when done if beepr is installed.
never_give_up(expr, sound = "fanfare", message = "Never gonna give you up.")
expr |
Expression to be evaluated |
sound |
Fed into beepr::beep(). Defaults to 'fanfare' |
Output of expression when completed
test <- function(e){if(runif(1) < 0.8){stop("Error")}else{"Good"}}
never_give_up(test())
never_give_up(test(), sound = "mario", message = "I wish this would work...")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.