Checks to see if the current call has an argument with the name given in the input.
assert_has_arg(x, fn = sys.function(sys.parent()),
severity = getOption("assertive.severity", "stop"))has_arg(x, fn = sys.function(sys.parent()))
has_arg_(x, fn = sys.function(sys.parent()))
Argument to check.
Function to find the argument in.
How severe should the consequences of the assertion be?
Either "stop"
, "warning"
, "message"
, or "none"
.
has_arg
reimplements hasArg
,
letting you choose the function to search in, and providing more
information on failure.
# NOT RUN { has_arg(x, mean.default) has_arg(y, mean.default) f <- function(...) has_arg(z) f(z = 123) f(123) # }