EVOLUTION-MANAGER
Edit File: prod.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: Product of Vector Elements</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 prod {base}"><tr><td>prod {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Product of Vector Elements</h2> <h3>Description</h3> <p><code>prod</code> returns the product of all the values present in its arguments. </p> <h3>Usage</h3> <pre> prod(..., na.rm = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>numeric or complex or logical vectors.</p> </td></tr> <tr valign="top"><td><code>na.rm</code></td> <td> <p>logical. Should missing values be removed?</p> </td></tr> </table> <h3>Details</h3> <p>If <code>na.rm</code> is <code>FALSE</code> an <code>NA</code> value in any of the arguments will cause a value of <code>NA</code> to be returned, otherwise <code>NA</code> values are ignored. </p> <p>This is a generic function: methods can be defined for it directly or via the <code><a href="groupGeneric.html">Summary</a></code> group generic. For this to work properly, the arguments <code>...</code> should be unnamed, and dispatch is on the first argument. </p> <p>Logical true values are regarded as one, false values as zero. For historical reasons, <code>NULL</code> is accepted and treated as if it were <code>numeric(0)</code>. </p> <h3>Value</h3> <p>The product, a numeric (of type <code>"double"</code>) or complex vector of length one. <strong>NB:</strong> the product of an empty set is one, by definition. </p> <h3>S4 methods</h3> <p>This is part of the S4 <code><a href="../../methods/html/S4groupGeneric.html">Summary</a></code> group generic. Methods for it must use the signature <code>x, ..., na.rm</code>. </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="sum.html">sum</a></code>, <code><a href="cumsum.html">cumprod</a></code>, <code><a href="cumsum.html">cumsum</a></code>. </p> <p>‘<a href="../../grDevices/html/plotmath.html">plotmath</a>’ for the use of <code>prod</code> in plot annotation. </p> <h3>Examples</h3> <pre> print(prod(1:7)) == print(gamma(8)) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>