Checks if ... is unused
length(list(...)) == 0L
Usage
chk_unused(...)
vld_unused(...)
Arguments
- ...
Additional arguments.
Value
The chk_
function throws an informative error if the test fails.
Examples
# chk_unused
fun <- function(x, ...) {
chk_unused(...)
x
}
fun(1)
#> [1] 1
try(fun(1, 2))
#> Error in fun(1, 2) : `...` must be unused.
# vld_unused
fun <- function(x, ...) {
vld_unused(...)
}
fun(1)
#> [1] TRUE
try(fun(1, 2))
#> [1] FALSE