melt.ts: melt.ts

Description Usage Arguments Value Author(s) Examples

View source: R/pub01_utilityFuncs.R

Description

melt the multi-columns timeseries to single-column dataframe for easy ggploting.

Usage

1
2
## S3 method for class 'ts'
melt(ts)

Arguments

ts

a zoo, timeSeries or xts object

Value

a data frame object melted from the ts,with cols:time,variable,value

Author(s)

Ruifei.Yin

Examples

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

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