Skip to contents

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}!"
)

Arguments

func

Character. A function you expect to run multiple times

runs

Numeric. Number of runs in time frame before praise

minutes

Numeric. Number of minutes in time frame

template

Character. Praise template

Value

Returns the output of func

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()")
} # }