diff options
Diffstat (limited to 'R')
| -rw-r--r-- | R/load_cf.R | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/R/load_cf.R b/R/load_cf.R index 10a10c6d..d95eb3b6 100644 --- a/R/load_cf.R +++ b/R/load_cf.R @@ -5,17 +5,13 @@ library(readr) library(data.table)
args <- commandArgs(trailingOnly=TRUE)
-if(.Platform$OS.type == "unix"){
- root.dir <- "/home/share/CorpCDOs"
+root.dir <- if(.Platform$OS.type == "unix"){
+ "/home/share/CorpCDOs"
}else{
- root.dir <- "//WDSENTINEL/share/CorpCDOs"
+ "//WDSENTINEL/share/CorpCDOs"
}
-if(length(args) >= 1){
- tradedate <- as.Date(args[1])
-}else{
- tradedate <- Sys.Date()
-}
+tradedate <- if(length(args) >= 1) as.Date(args[1]) else Sys.Date()
source(file.path(root.dir, "code", "R", "etdb.R"))
source(file.path(root.dir, "code", "R", "yieldcurve.R"))
@@ -31,7 +27,8 @@ index <- set.index.desc(index, tradedate) calibration.date <- addBusDay(tradedate, -1)
exportYC(calibration.date)
-cs <- couponSchedule(IMMDate(calibration.date, noadj=TRUE), index$maturity, "Q", "FLOAT", 0, 0.05)
+cs <- couponSchedule(IMMDate(calibration.date, noadj=TRUE), index$maturity,
+ "Q", "FLOAT", 0, 0.05, calibration.date)
dm <- 0
sanitize.column <- function(vec){
|
