aboutsummaryrefslogtreecommitdiffstats
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/load_cf.R14
1 files changed, 7 insertions, 7 deletions
diff --git a/R/load_cf.R b/R/load_cf.R
index d0f7708b..ff9235c7 100644
--- a/R/load_cf.R
+++ b/R/load_cf.R
@@ -127,7 +127,7 @@ getdealcf <- function(dealnames, zipfiles, tradedate=Sys.Date()){
conn <- unz(zip, filename)
data <- tryCatch(read_tsv(conn, col_types= ct),
warning=function(w){
- logwarning(conditionMessage(w))
+ logwarn(conditionMessage(w))
NULL},
error=function(e){
logerror(conditionMessage(e))
@@ -143,7 +143,7 @@ getdealcf <- function(dealnames, zipfiles, tradedate=Sys.Date()){
data[,`:=`(Cashflow = sanitize.column(Cashflow),
Principal = sanitize.column(Principal))]
}, warning=function(w){
- logwarning(conditionMessage(w))
+ logwarn(conditionMessage(w))
NULL})
data <- df[data, roll=TRUE]
data$Discounts[is.na(data$Discounts)] <- 1
@@ -171,10 +171,10 @@ getdealcf <- function(dealnames, zipfiles, tradedate=Sys.Date()){
cfdata[[dealname]] <- tryCatch({cfdata[[dealname]]$weight <-
KLfit(t(cf)/1e8, rep(1/n.scenarios, n.scenarios),
dealdata$mv/1e8)$weight;
- loginfo(dealname);
+ loginfo(paste("done", dealname));
cfdata[[dealname]]},
error = function(e) {
- logerror(cat("error computing the weights for deal:", dealname))
+ logerror(paste("error computing the weights for deal:", dealname))
NULL
})
}
@@ -241,13 +241,13 @@ getcusipcf <- function(params, cfdata, dist, tradedate=Sys.Date()){
col_numeric(), col_numeric(), col_numeric(),
col_skip(), col_skip())),
warning=function(w){
- message(conditionMessage(w))
+ logwarn(conditionMessage(w))
NULL},
error=function(e){
- message(conditionMessage(e))
+ logerror(conditionMessage(e))
NULL})
if(is.null(data)||nrow(data)<=2){
- cat(cusip, "Scenario", j, "\n")
+ loginfo(paste(cusip, "Scenario", j))
flag <- FALSE
break
}