data_raw/create_data_set.R

#' Creates sample data-set (Sigma + returns

files <- dir('D:Portfolio/Data/BRK',full.names=TRUE)[1:100]
Sigma <- replicate(100, diag(20), simplify=F)
for(f in 1:100){
    tmp <- readRDS(files[f])
    Sigma[[f]] <- tmp[1:20,1:20]
}
Sigma <- simplify2array(Sigma)
devtools::use_data(Sigma, overwrite=TRUE)

returns <- readRDS('D:/Portfolio_Backup/AddInformation/returns.rda')
returns <- returns[1:100,1:20]
r <- as.matrix(returns)
row.names(r)<-NULL
returns <- data.frame(Date=time(returns), r)

devtools::use_data(returns, overwrite=TRUE)
voigtstefan/RrealCov documentation built on Sept. 23, 2017, 12:17 a.m.