A thin wrapper around a function (e.g devtools::check()) that provides affirmation after X calls in Y minutes. Praise gets drunker as the number of actual runs exceeds the number of runs in the time frame.
Usage
spritz(
func = "devtools::check()",
runs = 3,
minutes = 10,
template = "You are ${adverb} ${adjective}!"
)
Examples
if (FALSE) { # \dontrun{
# default is to run devtools::check()
spritz()
# with a different function and praise template
spritz("devtools::document()",
template = "You are ${creating} a ${adverb} ${adjective} ${rpackage}")
# change rate depending on speed of devtools::check()
spritz(runs = 4, minutes = 15)
## custom function
sleep_add <- function() {
Sys.sleep(2)
out <- 1 + 1
return(out)
}
spritz(func = "sleep_add()")
} # }