View source: R/dots-ellipsis.R
check_dots_empty | R Documentation |
...
can be inserted in a function signature to force users to
fully name the details arguments. In this case, supplying data in
...
is almost always a programming error. This function checks
that ...
is empty and fails otherwise.
check_dots_empty(
env = caller_env(),
error = NULL,
call = caller_env(),
action = abort
)
env |
Environment in which to look for |
error |
An optional error handler passed to |
call |
The execution environment of a currently
running function, e.g. |
action |
In packages, document ...
with this standard tag:
@inheritParams rlang::args_dots_empty
Other dots checking functions:
check_dots_unnamed()
,
check_dots_used()
f <- function(x, ..., foofy = 8) {
check_dots_empty()
x + foofy
}
# This fails because `foofy` can't be matched positionally
try(f(1, 4))
# This fails because `foofy` can't be matched partially by name
try(f(1, foof = 4))
# Thanks to `...`, it must be matched exactly
f(1, foofy = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.