
match.call
returns a call in which all of the specified arguments are
specified by their full names.
match.call(definition = sys.function(sys.parent()), call = sys.call(sys.parent()), expand.dots = TRUE, envir = parent.frame(2L))
match.call
is called. See details.definition
, as generated by call
....
in the call be included or left as a ...
argument?...
in call
are retrieved, if any.call
.
match.call
does not support
primitive functions (where argument matching is normally
positional). match.call
is most commonly used in two circumstances:
call
of
the list they return. Here the default expand.dots = TRUE
is appropriate.
model.frame
. Here the common idiom is that
expand.dots = FALSE
is used, and the ...
element
of the matched call is removed. An alternative is to
explicitly select the arguments to be passed on, as is done in
lm
.
Calling match.call
outside a function without specifying
definition
is an error.
sys.call()
is similar, but does not expand the
argument names;
call
, pmatch
, match.arg
,
match.fun
.
match.call(get, call("get", "abc", i = FALSE, p = 3))
## -> get(x = "abc", pos = 3, inherits = FALSE)
fun <- function(x, lower = 0, upper = 1) {
structure((x - lower) / (upper - lower), CALL = match.call())
}
fun(4 * atan(1), u = pi)
Run the code above in your browser using DataLab