| match.call {base} | R Documentation |
Argument Matching
Description
match.call returns a call in which all of the specified arguments are
specified by their full names.
Usage
match.call(definition = NULL, call = sys.call(sys.parent()),
expand.dots = TRUE)
Arguments
definition |
a function, by default the function from which
|
call |
an unevaluated call to the function specified by
|
expand.dots |
logical. Should arguments matching |
Details
match.call is most commonly used in two circumstances:
To record the call for later re-use: for example most model-fitting functions record the call as element
callof the list they return. Here the defaultexpand.dots = TRUEis appropriate.To pass most of the call to another function, often
model.frame. Here the common idiom is thatexpand.dots = FALSEis used, and the...elememt of the matched call is removed. An alternative is to explicitly select the arguments to be passed on, as is done inlm.
Value
An object of class call.
References
Chambers, J. M. (1998) Programming with Data. A Guide to the S Language. Springer.
See Also
call, pmatch, match.arg,
match.fun.
Examples
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)