satrapade / pairs

1 stars 1 forks source link

loading "all results" is a really bad idea #67

Closed nassuphis closed 6 years ago

nassuphis commented 6 years ago

results that are needed should be loaded explicitly:

for(i in 1:nrow(data_loaded)){
    if(data_loaded$class[i]!="matrix")next;
    data_read
    assign(data_loaded$name[i],load_matrix(data_loaded$fn[i],row_names = TRUE))
}
rm("i")
nassuphis commented 6 years ago

only factor_local_tret was used, added this and removed above snippet:

factor_local_tret<-readLines(
  if(off_site){
    "https://raw.githubusercontent.com/satrapade/pairs/master/data/factor_local_tret.csv"
  } else {
    "N:/Depts/Share/UK Alpha Team/Analytics/market_data/factor_local_tret.csv"
  }
) %>% 
  paste0(collapse="\n") %>% 
  fread %>%
  {m<-as.matrix(.[,-1]); rownames(m)<-.[[1]]; m }