diff options
| -rw-r--r-- | R/tranches_RV_BC.R | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/R/tranches_RV_BC.R b/R/tranches_RV_BC.R index 29a922f7..1fd63791 100644 --- a/R/tranches_RV_BC.R +++ b/R/tranches_RV_BC.R @@ -1,12 +1,7 @@ -if(.Platform$OS.type == "unix"){ - root.dir <- "/home/share/CorpCDOs" -}else{ - root.dir <- "//WDSENTINEL/share/CorpCDOs" -} library(logging) basicConfig() removeHandler('basic.stdout') -addHandler(writeToFile, file=file.path(root.dir, "logs", "tranches_RV_BC.log")) +addHandler(writeToFile, file=file.path(Sys.getenv("LOG_DIR"), "tranches_RV_BC.log")) library(optparse) option_list <- list( make_option(c("-u", "--update"), action="store_true", default=FALSE, @@ -32,14 +27,15 @@ if(is.null(args$config)){ runs <- list(mappings=list(c(args$index1, args$tenor1, args$index2, args$tenor2))) }else{ library(yaml) - runs <- yaml.load_file(file.path(root.dir, "code", "etc", args$config)) + runs <- yaml.load_file(file.path(Sys.getven("CODE_DIR"), "etc", args$config)) } -source(file.path(root.dir, "code", "R", "optimization.R")) -source(file.path(root.dir, "code", "R", "calibration.R"), chdir=TRUE) -source(file.path(root.dir, "code", "R", "serenitasdb.R")) -source(file.path(root.dir, "code", "R", "creditIndex.R")) -source(file.path(root.dir, "code", "R", "tranche_functions.R")) +code.dir <- Sys.getven("CODE_DIR") +source(file.path(code.dir, "R", "optimization.R")) +source(file.path(code.dir, "R", "calibration.R"), chdir=TRUE) +source(file.path(code.dir, "R", "serenitasdb.R")) +source(file.path(code.dir, "R", "creditIndex.R")) +source(file.path(code.dir, "R", "tranche_functions.R")) for(r in runs$mappings){ index.name1 <- r[1] |
