rtn.lastperiods: rtn.lastperiods

Description Usage Arguments Value Author(s) Examples

View source: R/pub01_utilityFuncs.R

Description

get a return of different last periods of the rtn series(including overall cumulativereturn).

Usage

1
2
rtn.lastperiods(rtn, periods = list(months(1), months(3), months(6), years(1),
  years(3), years(5)))

Arguments

rtn

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

periods

a list, with elements of class "Period",eg.list(months(1),months(3)), giving the last periods.

Value

a matrix

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)
rtn.lastperiods(rtn,list(months(3),months(6),years(1)))

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