Learn R Programming

timeSeries (version 280.75)

colCum: Cumulated Column Statistics

Description

Functions to compute cumulative column statistics.

Usage

## S3 method for class 'default':
colCumsums(x, na.rm = FALSE, \dots)
## S3 method for class 'timeSeries':
colCumsums(x, na.rm = FALSE, \dots)

## S3 method for class 'default': colCummaxs(x, na.rm = FALSE, \dots) ## S3 method for class 'timeSeries': colCummaxs(x, na.rm = FALSE, \dots)

## S3 method for class 'default': colCummins(x, na.rm = FALSE, \dots) ## S3 method for class 'timeSeries': colCummins(x, na.rm = FALSE, \dots)

## S3 method for class 'default': colCumprods(x, na.rm = FALSE, \dots) ## S3 method for class 'timeSeries': colCumprods(x, na.rm = FALSE, \dots)

## S3 method for class 'default': colCumreturns(x, method = c("geometric", "simple"), na.rm = FALSE, ...) ## S3 method for class 'timeSeries': colCumreturns(x, method = c("geometric", "simple"), na.rm = FALSE, ...)

Arguments

method
a character string to indicate if geometric (TRUE) or simple (FALSE) returns should be computed.
na.rm
a logical. Should missing values be removed?
x
a time series, may be an object of class "matrix", or "timeSeries".
...
arguments to be passed.

Value

  • all functions return an S4 object of class timeSeries.

Examples

Run this code
## Simulated Monthly Return Data:
   x = matrix(rnorm(24), ncol = 2)
     
## colStats -
   colCumsums(x)

Run the code above in your browser using DataLab