aboutsummaryrefslogtreecommitdiffstats
path: root/R/script_calibrate_tranches.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/script_calibrate_tranches.R')
-rw-r--r--R/script_calibrate_tranches.R3
1 files changed, 2 insertions, 1 deletions
diff --git a/R/script_calibrate_tranches.R b/R/script_calibrate_tranches.R
index 8cd3182f..99dc1527 100644
--- a/R/script_calibrate_tranches.R
+++ b/R/script_calibrate_tranches.R
@@ -20,7 +20,8 @@ source(file.path(root.dir, "code", "R", "optimization.R"))
#figure out the workdate
filenames <- list.files(file.path(root.dir, "Scenarios", "Calibration"),
pattern = "hy19_singlenames*")
-dates <- sapply(filenames, function(x)x[3])
+
+dates <- strtrim(sapply(strsplit(filenames, "_"), function(x)x[3]), 10)
workdate <- as.Date(sort(dates, decreasing = TRUE)[1])
#retreive yield curve data