diff options
| -rw-r--r-- | R/intex_deal_functions.R | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/R/intex_deal_functions.R b/R/intex_deal_functions.R index 053d9c83..d2897119 100644 --- a/R/intex_deal_functions.R +++ b/R/intex_deal_functions.R @@ -214,7 +214,9 @@ buildSC <- function(line.item, reinvdate, dealmaturity, global.params, startdate SC@curve <- try
}
}
- if(maturity(SC) <= reinvdate){ #we reinvest
+ if(!is.na(reinvdate) && maturity(SC) <= reinvdate){
+ ## if reinvdate is missing, assume no reinvestment
+ ## otherwise reinvest
newstartdate <- line.item$maturity
line.item$maturity <- min(dealmaturity, newstartdate + global.params$rollingmaturity)
SC <- stackcurve(SC, line.item, global.params, newstartdate)
|
