aboutsummaryrefslogtreecommitdiffstats
path: root/R/thetas-durations.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/thetas-durations.R')
-rw-r--r--R/thetas-durations.R12
1 files changed, 4 insertions, 8 deletions
diff --git a/R/thetas-durations.R b/R/thetas-durations.R
index 9aeaad20..54e79f8f 100644
--- a/R/thetas-durations.R
+++ b/R/thetas-durations.R
@@ -4,18 +4,14 @@ library(doParallel)
library(dplyr)
library(tidyr)
-root.dir <- if(.Platform$OS.type == "unix"){
- "/home/share/CorpCDOs"
-}else{
- "//WDSENTINEL/share/CorpCDOs"
-}
+code.dir <- Sys.getenv("CODE_DIR")
hostname <- system("hostname", intern=TRUE)
registerDoParallel(if(hostname=="debian") 4 else 8)
-source(file.path(root.dir, "code", "R", "serenitasdb.R"))
-source(file.path(root.dir, "code", "R", "cds_functions_generic.R"))
-source(file.path(root.dir, "code", "R", "yieldcurve.R"))
+source(file.path(code.dir, "R", "serenitasdb.R"))
+source(file.path(code.dir, "R", "cds_functions_generic.R"))
+source(file.path(code.dir, "R", "yieldcurve.R"))
get.indexquotes.table <- function(indextype, series, tenors=c("3yr", "5yr", "7yr"), onlymissing=TRUE){
stmt <- str_c("select date, tenor, closeprice from index_quotes ",