Cumulative row statistics
statistics-rowCumsums.Rd
Compute cumulative row statistics.
Usage
# S4 method for ANY
rowCumsums(x, na.rm = FALSE, ...)
# S4 method for timeSeries
rowCumsums(x, na.rm = FALSE, ...)
Arguments
- x
-
a time series, may be an object of class
"matrix"
or"timeSeries"
. - na.rm
a logical. Should missing values be removed?
- ...
arguments to be passed.
Value
for the default method, a matrix,
for the "timeSeries"
method, an S4 object of class "timeSeries"
.
Examples
## Simulated Monthly Return Data -
X = matrix(rnorm(24), ncol = 2)
## Compute cumulated Sums -
rowCumsums(X)
#> [,1] [,2]
#> [1,] 0.37811452 -1.9438833
#> [2,] 1.21417980 1.4494039
#> [3,] 0.79483540 1.8357962
#> [4,] 0.44748585 0.6263650
#> [5,] 0.02806906 1.2087300
#> [6,] 0.67964150 1.1739693
#> [7,] 0.96136088 1.2564244
#> [8,] -0.16347488 0.9412349
#> [9,] -0.42564936 -2.3020616
#> [10,] -1.41569456 -1.8622381
#> [11,] -0.27908161 0.6510722
#> [12,] -0.73436941 -1.1184703