StackRet {RMOPI} | R Documentation |
Stack Rets for ggplot
Description
Change the arrangement of multivariate data to generate suitable data for ggplot.
Usage
StackRet(rets, date)
Arguments
rets |
multivariate data, arranged by column |
date |
vector of common information for variables |
Value
Suitable tibble data for plot by group in ggplot
Examples
names <- c("swan", "bear", "tiger")
date <- as.Date("2015-01-01") + days(0:179)
mu <- c(0.2, 0.08, 0.1)
sigma <- matrix(c(1, 0.25, -0.3, 0.25, 0.25, 0, -0.3, 0, 0.36), 3, 3)
allret <- rMvReturnSim(names, date, mu, sigma)
StackRet(allret, date)
[Package RMOPI version 1.1 Index]