EVOLUTION-MANAGER
Edit File: period.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: Calculate Product By Period</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 period.prod {xts}"><tr><td>period.prod {xts}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Calculate Product By Period </h2> <h3>Description</h3> <p>Calculate a product for each period of INDEX. Essentially a rolling application of prod over a series of non-overlapping sections. </p> <h3>Usage</h3> <pre> period.prod(x, INDEX) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p> a univariate data object </p> </td></tr> <tr valign="top"><td><code>INDEX</code></td> <td> <p> a vector of breakpoints to calculate product on </p> </td></tr> </table> <h3>Details</h3> <p>Used to calculate a product per period given an arbitrary index of sections to be calculated over. This is an optimized function for product. There are additionally optimized versions for min, max, and sum. </p> <p>For xts-coercible objects, an appropriate INDEX can be derived from a call to <code>endpoints</code>. </p> <h3>Value</h3> <p>An <code>xts</code> or <code>zoo</code> object of products, indexed by the period endpoints. </p> <h3>Author(s)</h3> <p> Jeffrey A. Ryan </p> <h3>See Also</h3> <p><code><a href="endpoints.html">endpoints</a></code>, <code><a href="period.sum.html">period.sum</a></code>, <code><a href="period.min.html">period.min</a></code>, <code><a href="period.max.html">period.max</a></code> </p> <h3>Examples</h3> <pre> period.prod(c(1,1,4,2,2,6,7,8,-1,20),c(0,3,5,8,10)) data(sample_matrix) period.prod(sample_matrix[,1],endpoints(sample_matrix)) period.prod(as.xts(sample_matrix)[,1],endpoints(sample_matrix)) </pre> <hr /><div style="text-align: center;">[Package <em>xts</em> version 0.12.2 <a href="00Index.html">Index</a>]</div> </body></html>