tests/testfiles/have-args.R

excite <- function(.f, level = 1) {
  stopifnot(is.numeric(level))
  function(...) {
    val <- .f(...)
    paste0(val, strrep('!', level))
  }
}

#. excite(5)
my_name <- function(x) {
  rep('Nathan Teetor', times = x)
}

#. excite(level = 10)
too_energetic <- function(x) {
  rep('Nathan Teetor', times = x)
}

Try the tinsel package in your browser

Any scripts or data that you put into this service are public.

tinsel documentation built on May 2, 2019, 1:30 p.m.