colCum | R Documentation |
Functions to compute cumulative column statistics.
## S4 method for signature 'timeSeries'
colCumsums(x, na.rm = FALSE, ...)
## S4 method for signature 'timeSeries'
colCummaxs(x, na.rm = FALSE, ...)
## S4 method for signature 'timeSeries'
colCummins(x, na.rm = FALSE, ...)
## S4 method for signature 'timeSeries'
colCumprods(x, na.rm = FALSE, ...)
## S4 method for signature 'timeSeries'
colCumreturns(x, method = c("geometric", "simple"),
na.rm = FALSE, ...)
x |
a time series, may be an object of class |
na.rm |
a logical. Should missing values be removed? |
method |
a character string to indicate if geometric ( |
... |
arguments to be passed. |
These functions compute the requested cumulative quantities columnwise
to obtain a matrix of the same dimension as the data. The
"timeSeries"
methods replace the data part of the original
object with the resulting matrix.
The "timeSeries"
methods for the Math
group functions
cummin
, cummax
, cumsum
, and cumprod
,
work similarly but don't have the na.rm
argument.
"matrix"
for the default methods of all functions,
"timeSeries"
for the "timeSeries"
methods
Math,timeSeries-method
,
rowCumsums
## simulate return data
x <- matrix(rnorm(24), ncol = 2)
X <- as.timeSeries(x)
## cumulative sums by column -
class(colCumsums(x)) # "matrix"
class(colCumsums(X)) # "timeSeries"
colCumsums(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.