EVOLUTION-MANAGER
Edit File: MathFun.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: Miscellaneous Mathematical Functions</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 MathFun {base}"><tr><td>MathFun {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Miscellaneous Mathematical Functions</h2> <h3>Description</h3> <p><code>abs(x)</code> computes the absolute value of x, <code>sqrt(x)</code> computes the (principal) square root of x, <i>√{x}</i>. </p> <p>The naming follows the standard for computer languages such as C or Fortran. </p> <h3>Usage</h3> <pre> abs(x) sqrt(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a numeric or <code><a href="complex.html">complex</a></code> vector or array.</p> </td></tr> </table> <h3>Details</h3> <p>These are <a href="InternalMethods.html">internal generic</a> <a href="Primitive.html">primitive</a> functions: methods can be defined for them individually or via the <code><a href="groupGeneric.html">Math</a></code> group generic. For complex arguments (and the default method), <code>z</code>, <code>abs(z) == <a href="complex.html">Mod</a>(z)</code> and <code>sqrt(z) == z^0.5</code>. </p> <p><code>abs(x)</code> returns an <code><a href="integer.html">integer</a></code> vector when <code>x</code> is <code>integer</code> or <code><a href="logical.html">logical</a></code>. </p> <h3>S4 methods</h3> <p>Both are S4 generic and members of the <code><a href="../../methods/html/S4groupGeneric.html">Math</a></code> group generic. </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="Arithmetic.html">Arithmetic</a></code> for simple, <code><a href="Log.html">log</a></code> for logarithmic, <code><a href="Trig.html">sin</a></code> for trigonometric, and <code><a href="Special.html">Special</a></code> for special mathematical functions. </p> <p>‘<a href="../../grDevices/html/plotmath.html">plotmath</a>’ for the use of <code>sqrt</code> in plot annotation. </p> <h3>Examples</h3> <pre> require(stats) # for spline require(graphics) xx <- -9:9 plot(xx, sqrt(abs(xx)), col = "red") lines(spline(xx, sqrt(abs(xx)), n=101), col = "pink") </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>