aggr.rtn: aggr.rtn

Description Usage Arguments Value Author(s) Examples

View source: R/pub01_utilityFuncs.R

Description

aggregate the return series into specific freq

Usage

1
aggr.rtn(rtn, freq)

Arguments

rtn

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

freq

An interval specification, one of "day", "week", "month", "quarter" and "year", optionally preceded by an integer and a space, or followed by "s".See cut.Date for detail.

Value

a aggregated return series, of the same class of rtn.

Author(s)

Ruifei.yin

Examples

1
2
3
4
rtn.long <- zoo(rnorm(100,0.001,0.02),as.Date("2010-01-01")+1:100)
rtn.short <- rtn.long + rnorm(100,-0.001,0.003)
rtn <- merge(rtn.long,rtn.short)
aggr.rtn(rtn,"month")

raphael210/QUtility documentation built on May 26, 2019, 11:05 p.m.