scrubNames: Scrub the fund or asset names from an xts object and replace...

Description Usage Arguments Value Examples

View source: R/scrubNames.R

Description

Sometimes it is necessary to cover up the names of the funds when distributing analyses to colleagues. This little function takes care of that problem.

Usage

1

Arguments

x

an xts object to be scrubbed.

Value

an xts object with the names replaced by 'Fund.x' where x is a number ranging from 1 to ncol(x).

Examples

1
2
3
4
5
6
dts <- seq(Sys.Date()-199, Sys.Date(), 1)
returns <- matrix(rnorm(1000),ncol = 5) / 100
ret.xts <- xts(returns, dts)
colnames(ret.xts) <- rep(c("Real Name"),ncol(ret.xts))
ret.nonames <- scrubNames(ret.xts)
head(ret.nonames)

gtog/dMisc documentation built on May 17, 2019, 8:57 a.m.