aboutsummaryrefslogtreecommitdiffstats
path: root/R/calibrate_tranches_BC.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/calibrate_tranches_BC.R')
-rw-r--r--R/calibrate_tranches_BC.R6
1 files changed, 3 insertions, 3 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index 7487bc80..bcc706f4 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -16,7 +16,8 @@ option_list <- list(
help="Runs the list of indices provided in CONFIG_FILE"),
make_option(c("-i", "--index"), help="Index name we want to run"),
make_option("--tenor", default="5yr", help="Tenor we want to run [default %default]"),
- make_option("--until", default=Sys.Date()-1, help="last date to run [default %default]"))
+ make_option("--until", default=Sys.Date()-1, type="character",
+ help="last date to run [default %default]"))
args <- parse_args(OptionParser(option_list=option_list))
## default values
@@ -60,8 +61,7 @@ for(i in seq_along(runs$name)){
if(begin.date > as.Date(args$until)){
next
}
-
- alldates <- seq(begin.date, as.Date(args$until), by="1 day")
+ alldates <- seq(begin.date, as.Date(as.character(args$until)), by="1 day")
if(index.name=="ig19"){
alldates <- alldates[alldates!=as.Date("2013-11-29")] ##people are lazy the day after Thanksgiving
}