EVOLUTION-MANAGER
Edit File: match.call.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Argument Matching</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for match.call {base}"><tr><td>match.call {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Argument Matching</h2> <h3>Description</h3> <p><code>match.call</code> returns a call in which all of the specified arguments are specified by their full names. </p> <h3>Usage</h3> <pre> match.call(definition = sys.function(sys.parent()), call = sys.call(sys.parent()), expand.dots = TRUE, envir = parent.frame(2L)) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>definition</code></td> <td> <p>a function, by default the function from which <code>match.call</code> is called. See details.</p> </td></tr> <tr valign="top"><td><code>call</code></td> <td> <p>an unevaluated call to the function specified by <code>definition</code>, as generated by <code><a href="call.html">call</a></code>.</p> </td></tr> <tr valign="top"><td><code>expand.dots</code></td> <td> <p>logical. Should arguments matching <code>...</code> in the call be included or left as a <code>...</code> argument?</p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>an environment, from which the <code>...</code> in <code>call</code> are retrieved, if any.</p> </td></tr> </table> <h3>Details</h3> <p>‘function’ on this help page means an interpreted function (also known as a ‘closure’): <code>match.call</code> does not support primitive functions (where argument matching is normally positional). </p> <p><code>match.call</code> is most commonly used in two circumstances: </p> <ul> <li><p> To record the call for later re-use: for example most model-fitting functions record the call as element <code>call</code> of the list they return. Here the default <code>expand.dots = TRUE</code> is appropriate. </p> </li> <li><p> To pass most of the call to another function, often <code>model.frame</code>. Here the common idiom is that <code>expand.dots = FALSE</code> is used, and the <code>...</code> element of the matched call is removed. An alternative is to explicitly select the arguments to be passed on, as is done in <code>lm</code>. </p> </li></ul> <p>Calling <code>match.call</code> outside a function without specifying <code>definition</code> is an error. </p> <h3>Value</h3> <p>An object of class <code>call</code>. </p> <h3>References</h3> <p>Chambers, J. M. (1998) <em>Programming with Data. A Guide to the S Language</em>. Springer. </p> <h3>See Also</h3> <p><code><a href="sys.parent.html">sys.call</a>()</code> is similar, but does <em>not</em> expand the argument names; <code><a href="call.html">call</a></code>, <code><a href="pmatch.html">pmatch</a></code>, <code><a href="match.arg.html">match.arg</a></code>, <code><a href="match.fun.html">match.fun</a></code>. </p> <h3>Examples</h3> <pre> 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) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>