## 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)
Run the code above in your browser using DataLab