EVOLUTION-MANAGER
Edit File: args.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 List of a Function</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 args {base}"><tr><td>args {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Argument List of a Function</h2> <h3>Description</h3> <p>Displays the argument names and corresponding default values of a function or primitive. </p> <h3>Usage</h3> <pre> args(name) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>a function (a closure or a primitive). If <code>name</code> is a character string then the function with that name is found and used.</p> </td></tr> </table> <h3>Details</h3> <p>This function is mainly used interactively to print the argument list of a function. For programming, consider using <code><a href="formals.html">formals</a></code> instead. </p> <h3>Value</h3> <p>For a closure, a closure with identical formal argument list but an empty (<code>NULL</code>) body. </p> <p>For a primitive, a closure with the documented usage and <code>NULL</code> body. Note that some primitives do not make use of named arguments and match by position rather than name. </p> <p><code>NULL</code> in case of a non-function. </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="formals.html">formals</a></code>, <code><a href="../../utils/html/help.html">help</a></code>; <code><a href="../../utils/html/str.html">str</a></code> also prints the argument list of a function. </p> <h3>Examples</h3> <pre> ## "regular" (non-primitive) functions "print their arguments" ## (by returning another function with NULL body which you also see): args(ls) args(graphics::plot.default) utils::str(ls) # (just "prints": does not show a NULL) ## You can also pass a string naming a function. args("scan") ## ...but :: package specification doesn't work in this case. tryCatch(args("graphics::plot.default"), error = print) ## As explained above, args() gives a function with empty body: list(is.f = is.function(args(scan)), body = body(args(scan))) ## Primitive functions mostly behave like non-primitive functions. args(c) args(`+`) ## primitive functions without well-defined argument list return NULL: args(`if`) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>