Check that argument is supplied Throws an informative error if arg is missing.

arg_require(arg)

Arguments

arg

A function argument. Must be a symbol.

See also

Examples

f <- function(x) { arg_require(x) } # Fails because `x` is not supplied try(f())
#> Error : `f()` requires the argument `x` to be supplied.
# Succeeds f(NULL)
#> [1] TRUE