diff options
Diffstat (limited to 'R/yieldcurve.R')
| -rw-r--r-- | R/yieldcurve.R | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/R/yieldcurve.R b/R/yieldcurve.R index b0703096..f592c8c8 100644 --- a/R/yieldcurve.R +++ b/R/yieldcurve.R @@ -11,6 +11,7 @@ getMarkitIRData <- function(date=Sys.Date(), currency=c("USD", "EUR")) { ## before date and returns the parsed file into a list
require(xml2)
i <- 0
+ currency <- match.arg(currency)
while( TRUE ) {
lastdate <- format(date-i, "%Y%m%d")
filename <- paste("InterestRates", currency, lastdate, sep="_")
@@ -37,7 +38,6 @@ getMarkitIRData <- function(date=Sys.Date(), currency=c("USD", "EUR")) { }
}
}
- return( as_list(read_xml(paste(filename,".xml", sep=""))) )
}
thirdwed <- function(x) {
@@ -52,6 +52,7 @@ nextthirdwed <- function(x) { }
buildMarkitYC <- function(MarkitData, currency=c("USD", "EUR"), futurequotes){
+ currency <- match.arg(currency)
deposits <- list()
futures <- list()
swaps <- list()
@@ -92,6 +93,7 @@ buildMarkitYC <- function(MarkitData, currency=c("USD", "EUR"), futurequotes){ exportYC <- function(tradedate=Sys.Date(), currency=c("USD", "EUR"), useFutures=FALSE){
## export the Yield Curve into the environment
+ currency <- match.arg(currency)
require(RQuantLib)
if(useFutures){
futurefile <- file.path(data.dir, "Yield Curves",
|
