aboutsummaryrefslogtreecommitdiffstats
path: root/R/cds_utils.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/cds_utils.R')
-rw-r--r--R/cds_utils.R8
1 files changed, 6 insertions, 2 deletions
diff --git a/R/cds_utils.R b/R/cds_utils.R
index 3685056e..fe7bb4ec 100644
--- a/R/cds_utils.R
+++ b/R/cds_utils.R
@@ -94,9 +94,13 @@ couponSchedule <- function(nextpaydate=NULL, maturity, frequency, coupontype, cu
stop("unknown frequency")
}
if(is.null(nextpaydate)){
- dates <- rev(seq(maturity, today(), by =paste0("-", bystring)))
+ dates <- rev(seq(maturity, startdate, by =paste0("-", bystring)))
}else{
- dates <- seq(nextpaydate, maturity, by = bystring)
+ if(nextpaydate>maturity){
+ dates <- maturity
+ }else{
+ dates <- seq(nextpaydate, maturity, by = bystring)
+ }
}
if(length(dates)==0){
dates <- maturity