EVOLUTION-MANAGER
Edit File: as.function.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: Convert Object to 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 as.function {base}"><tr><td>as.function {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Convert Object to Function</h2> <h3>Description</h3> <p><code>as.function</code> is a generic function which is used to convert objects to functions. </p> <p><code>as.function.default</code> works on a list <code>x</code>, which should contain the concatenation of a formal argument list and an expression or an object of mode <code>"<a href="call.html">call</a>"</code> which will become the function body. The function will be defined in a specified environment, by default that of the caller. </p> <h3>Usage</h3> <pre> as.function(x, ...) ## Default S3 method: as.function(x, envir = parent.frame(), ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>object to convert, a list for the default method.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional arguments, depending on object</p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>environment in which the function should be defined</p> </td></tr> </table> <h3>Value</h3> <p>The desired function. </p> <h3>Note</h3> <p>For ancient historical reasons, <code>envir = NULL</code> uses the global environment rather than the base environment. Please use <code>envir = <a href="environment.html">globalenv</a>()</code> instead if this is what you want, as the special handling of <code>NULL</code> may change in a future release. </p> <h3>Author(s)</h3> <p>Peter Dalgaard</p> <h3>See Also</h3> <p><code><a href="function.html">function</a></code>; <code><a href="list.html">alist</a></code> which is handy for the construction of argument lists, etc. </p> <h3>Examples</h3> <pre> as.function(alist(a = , b = 2, a+b)) as.function(alist(a = , b = 2, a+b))(3) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>