EVOLUTION-MANAGER
Edit File: vec_math.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: Mathematical operations</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 vec_math {vctrs}"><tr><td>vec_math {vctrs}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Mathematical operations</h2> <h3>Description</h3> <p>This generic provides a common dispatch mechanism for all regular unary mathematical functions. It is used as a common wrapper around many of the Summary group generics, the Math group generics, and a handful of other mathematical functions like <code>mean()</code> (but not <code>var()</code> or <code>sd()</code>). </p> <h3>Usage</h3> <pre> vec_math(.fn, .x, ...) vec_math_base(.fn, .x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>.fn</code></td> <td> <p>A mathematical function from the base package, as a string.</p> </td></tr> <tr valign="top"><td><code>.x</code></td> <td> <p>A vector.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments passed to <code>.fn</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>vec_math_base()</code> is provided as a convenience for writing methods. It calls the base <code>.fn</code> on the underlying <code><a href="vec_data.html">vec_data()</a></code>. </p> <h3>Included functions</h3> <ul> <li><p> From the <a href="../../methods/html/S4groupGeneric.html">Summary</a> group generic: <code>prod()</code>, <code>sum()</code>, <code>any()</code>, <code>all()</code>. </p> </li> <li><p> From the <a href="../../methods/html/S4groupGeneric.html">Math</a> group generic: <code>abs()</code>, <code>sign()</code>, <code>sqrt()</code>, <code>ceiling()</code>, <code>floor()</code>, <code>trunc()</code>, <code>cummax()</code>, <code>cummin()</code>, <code>cumprod()</code>, <code>cumsum()</code>, <code>log()</code>, <code>log10()</code>, <code>log2()</code>, <code>log1p()</code>, <code>acos()</code>, <code>acosh()</code>, <code>asin()</code>, <code>asinh()</code>, <code>atan()</code>, <code>atanh()</code>, <code>exp()</code>, <code>expm1()</code>, <code>cos()</code>, <code>cosh()</code>, <code>cospi()</code>, <code>sin()</code>, <code>sinh()</code>, <code>sinpi()</code>, <code>tan()</code>, <code>tanh()</code>, <code>tanpi()</code>, <code>gamma()</code>, <code>lgamma()</code>, <code>digamma()</code>, <code>trigamma()</code>. </p> </li> <li><p> Additional generics: <code>mean()</code>, <code>is.nan()</code>, <code>is.finite()</code>, <code>is.infinite()</code>. </p> </li></ul> <p>Note that <code>median()</code> is currently not implemented, and <code>sd()</code> and <code>var()</code> are currently not generic and so do not support custom classes. </p> <h3>See Also</h3> <p><code><a href="vec_arith.html">vec_arith()</a></code> for the equivalent for the arithmetic infix operators. </p> <h3>Examples</h3> <pre> x <- new_vctr(c(1, 2.5, 10)) x abs(x) sum(x) cumsum(x) </pre> <hr /><div style="text-align: center;">[Package <em>vctrs</em> version 0.5.0 <a href="00Index.html">Index</a>]</div> </body></html>