Description Usage Arguments Value See Also Examples
Cumulative Sums, Products, and Extremes
1 2 3 4 5 6 7 8 9 10 11 |
x |
|
... |
other parameters passed on to chunk |
An ff
vector of the same length and type as x (after coercion), except that cumprod returns a numeric vector for integer input.
An NA value in x causes the corresponding and following elements of the return value to be NA, as does integer overflow in cumsum (with a warning).
cumsum
, cumprod
, cummax
, cummin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | x <- 1:10000
tmp <- cumsum(ff(x))
class(tmp)
table(tmp[] == cumsum(x))
x <- rnorm(1000)
tmp <- cummax(ff(x))
table(tmp[] == cummax(x))
tmp <- cummin(ff(x))
table(tmp[] == cummin(x))
tmp <- cumprod(ff(x))
table(tmp[] == cumprod(x))
## S3 type of calling
cumsum(ff(x))
cummax(ff(x))
cummin(ff(x))
cumprod(ff(x))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.