EVOLUTION-MANAGER
Edit File: cumsum.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: Cumulative Sums, Products, and Extremes</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 cumsum {base}"><tr><td>cumsum {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Cumulative Sums, Products, and Extremes</h2> <h3>Description</h3> <p>Returns a vector whose elements are the cumulative sums, products, minima or maxima of the elements of the argument. </p> <h3>Usage</h3> <pre> cumsum(x) cumprod(x) cummax(x) cummin(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a numeric or complex (not <code>cummin</code> or <code>cummax</code>) object, or an object that can be coerced to one of these.</p> </td></tr> </table> <h3>Details</h3> <p>These are generic functions: methods can be defined for them individually or via the <code><a href="groupGeneric.html">Math</a></code> group generic. </p> <h3>Value</h3> <p>A vector of the same length and type as <code>x</code> (after coercion), except that <code>cumprod</code> returns a numeric vector for integer input (for consistency with <code>*</code>). Names are preserved. </p> <p>An <code>NA</code> value in <code>x</code> causes the corresponding and following elements of the return value to be <code>NA</code>, as does integer overflow in <code>cumsum</code> (with a warning). </p> <h3>S4 methods</h3> <p><code>cumsum</code> and <code>cumprod</code> are S4 generic functions: methods can be defined for them individually or via the <code><a href="../../methods/html/S4groupGeneric.html">Math</a></code> group generic. <code>cummax</code> and <code>cummin</code> are individually S4 generic functions. </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. (<code>cumsum</code> only.) </p> <h3>Examples</h3> <pre> cumsum(1:10) cumprod(1:10) cummin(c(3:1, 2:0, 4:2)) cummax(c(3:1, 2:0, 4:2)) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>