diff options
Diffstat (limited to 'R/creditIndex.R')
| -rw-r--r-- | R/creditIndex.R | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/R/creditIndex.R b/R/creditIndex.R index 7b49aa76..8ef15093 100644 --- a/R/creditIndex.R +++ b/R/creditIndex.R @@ -12,7 +12,11 @@ Ngrid <- 201 creditIndex <- function(name, tenor="5yr", Z=gh$Z, w=gh$w, N=Ngrid) { ## constructor for the index object ## FIXME: figure out what to do with the recovery - r <- list(name=name, tenor=tenor, Z=Z, w=w, N=N, recovery=0.4) + name <- toupper(name) + r <- list(name=name, + tenor=tenor, type = substr(name, 1, 2), + series=as.integer(substr(name, 3, nchar(name))), + Z=Z, w=w, N=N, recovery=0.4) return( structure(r, class="creditIndex") ) } |
