diff options
Diffstat (limited to 'R')
| -rw-r--r-- | R/calibrate_tranches_BC.R | 6 | ||||
| -rw-r--r-- | R/tranches_RV_BC.R | 4 |
2 files changed, 5 insertions, 5 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
}
diff --git a/R/tranches_RV_BC.R b/R/tranches_RV_BC.R index 8b008561..1419b9fe 100644 --- a/R/tranches_RV_BC.R +++ b/R/tranches_RV_BC.R @@ -19,7 +19,7 @@ option_list <- list( help="Tenor of index1 [default %default]"),
make_option(c("-t2", "--tenor2"), default="5yr",
help="Tenor of index2 [default %default]"),
- make_option("--until", default=Sys.Date()-1,
+ make_option("--until", default=Sys.Date()-1, type="character"
help="last day to run [default %default]"))
args <- parse_args(OptionParser(option_list=option_list,
@@ -62,7 +62,7 @@ for(i in seq_along(runs$name1)){ 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.name2=="ig19"){
alldates <- alldates[alldates!=as.Date("2013-11-29")] ##people are lazy the day after Thanksgiving
}
|
