diff options
Diffstat (limited to 'R/load_cf.R')
| -rw-r--r-- | R/load_cf.R | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/R/load_cf.R b/R/load_cf.R index 6d9878f3..a7ff824e 100644 --- a/R/load_cf.R +++ b/R/load_cf.R @@ -105,6 +105,9 @@ getdealcf <- function(dealnames, zipfiles, tradedate=Sys.Date()){ tranches <- "COLLAT"
}else{
tranches <- c("COLLAT_INITIAL", "COLLAT_REINVEST")
+ if(dealname=="octag11"){
+ tranches <- c("COLLAT_USD_INITIAL", "COLLAT_USD_REINVEST")
+ }
}
flag <- TRUE
ct <- list(col_date("%b %d, %Y"),
@@ -140,7 +143,10 @@ getdealcf <- function(dealnames, zipfiles, tradedate=Sys.Date()){ }, warning=function(w){
message(conditionMessage(w))
NULL})
- r[i,] <- as.numeric(df[data, roll=TRUE][,list(sum(Cashflow*Discounts),
+ data <- df[data, roll=TRUE]
+ data$Discounts[is.na(data$Discounts)] <- 1
+ data$T[is.na(data$T)] <- 0
+ r[i,] <- as.numeric(data[,list(sum(Cashflow*Discounts),
sum(Principal*Discounts),
sum(Interest*Discounts))])
}
|
