Returns a vector whose elements are the cumulative sums, products, minima or maxima of the elements of the argument.
cumsum(x)
cumprod(x)
cummax(x)
cummin(x)
| Parameter | Description |
|---|---|
x |
a numeric or complex (not cummin or cummax) object, or an object that can be coerced to one of these. |
# NOT RUN {
cumsum(1:10)
cumprod(1:10)
cummin(c(3:1, 2:0, 4:2))
cummax(c(3:1, 2:0, 4:2))
# }