EVOLUTION-MANAGER
Edit File: Primitive.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: Look Up a Primitive 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 Primitive {base}"><tr><td>Primitive {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Look Up a Primitive Function</h2> <h3>Description</h3> <p><code>.Primitive</code> looks up by name a ‘primitive’ (internally implemented) function. </p> <h3>Usage</h3> <pre> .Primitive(name) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>name of the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> function.</p> </td></tr> </table> <h3>Details</h3> <p>The advantage of <code>.Primitive</code> over <code><a href="Internal.html">.Internal</a></code> functions is the potential efficiency of argument passing, and that positional matching can be used where desirable, e.g. in <code><a href="switch.html">switch</a></code>. For more details, see the ‘R Internals Manual’. </p> <p>All primitive functions are in the base namespace. </p> <p>This function is almost never used: <code>`name`</code> or, more carefully, <code><a href="get.html">get</a>(name, envir = baseenv())</code> work equally well and do not depend on knowing which functions are primitive (which does change as <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> evolves). </p> <h3>See Also</h3> <p><code><a href="is.function.html">is.primitive</a></code> showing that primitive functions come in two types (<code><a href="typeof.html">typeof</a></code>), <code><a href="Internal.html">.Internal</a></code>. </p> <h3>Examples</h3> <pre> mysqrt <- .Primitive("sqrt") c .Internal # this one *must* be primitive! `if` # need backticks </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>