Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

check_dots_empty

Check that dots are unused


Description

Sometimes you just want to use ... to force your users to fully name the details arguments. This function warns if ... is not empty.

Arguments

env

Environment in which to look for ....

action

The action to take when the dots have not been used. One of rlang::abort(), rlang::warn(), rlang::inform() or rlang::signal().

Examples

f <- function(x, ..., foofy = 8) {
  check_dots_empty()
  x + foofy
}

try(f(1, foof = 4))
f(1, foofy = 4)

ellipsis

Tools for Working with ...

v0.3.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.