diff options
Diffstat (limited to 'R/yieldcurve.R')
| -rw-r--r-- | R/yieldcurve.R | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/R/yieldcurve.R b/R/yieldcurve.R index a73b28bd..7e39a0f2 100644 --- a/R/yieldcurve.R +++ b/R/yieldcurve.R @@ -4,9 +4,10 @@ source("db.R") getMarkitIRData <- function(date=Sys.Date(), currency=c("USD", "EUR")) { ## returns Markit rates from serenitasdb currency <- match.arg(currency) - sqlstr <- sprintf("SELECT * FROM %s_rates WHERE effective_date = $1", currency) + table_name <- paste(tolower(currency), "rates", sep="_") serenitasdb <- dbConn("serenitasdb") - return( dbGetQuery(serenitasdb, sqlstr, params = list(date)) ) + return( serenitasdb %>% tbl(table_name) + %>% filter(effective_date == date) %>% collect() ) } thirdwed <- function(x) { |
