Calculate a product for each period of INDEX. Essentially a rolling application of prod over a series of non-overlapping sections.
a univariate data object
a vector of breakpoints to calculate product on
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.
For xts-coercible objects, an appropriate INDEX can be
derived from a call to
zoo object of products,
indexed by the period endpoints.
Jeffrey A. Ryan
1 2 3 4 5
Loading required package: zoo Attaching package: 'zoo' The following objects are masked from 'package:base': as.Date, as.Date.numeric 3 5 8 10 4 4 336 -20 30 58 89 119 150 180 1.056649e+51 5.757944e+47 3.468070e+52 7.433317e+50 1.608181e+52 1.969971e+50 [,1] 2007-01-31 1.056649e+51 2007-02-28 5.757944e+47 2007-03-31 3.468070e+52 2007-04-30 7.433317e+50 2007-05-31 1.608181e+52 2007-06-30 1.969971e+50
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.