From e7e361de6804ed056a094d03155f79060303847b Mon Sep 17 00:00:00 2001 From: George Fisher Date: Mon, 1 Feb 2016 11:03:08 -0500 Subject: [PATCH] initial commit version 0.0.0.9000 --- R/APY.R | 4 ++++ R/USTreasuryRates.R | 12 +++++++++--- man/APY.Rd | 5 +++++ man/USTreasuryRates.Rd | 14 ++++++++++---- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/R/APY.R b/R/APY.R index d6f9d45..a6153a3 100644 --- a/R/APY.R +++ b/R/APY.R @@ -7,6 +7,10 @@ #' @param percent boolean, if TRUE, i should be divided by 100 #' (for example 7.87 becomes 0.0787) #' @return APY yield(s) as a decimal (not as a percent) +#' @references +#' Interest Rates - Frequently Asked Questions +#' +#' \url{https://www.treasury.gov/resource-center/faqs/Interest-Rates/Pages/faq.aspx#2} #' @examples #' APY(0.0800) #> [1] 0.0816 #' diff --git a/R/USTreasuryRates.R b/R/USTreasuryRates.R index 936dfb5..c0dec00 100644 --- a/R/USTreasuryRates.R +++ b/R/USTreasuryRates.R @@ -1,8 +1,7 @@ #' Download Constant-Maturity Treasury (CMT) rates #' #' For the dates 1962-01-02 to 2015-12-31 the data is retrieved from a static -#' file that was previously created from the data downloaded from -#' \url{http://www.federalreserve.gov/datadownload/Choose.aspx?rel=H15}; the +#' file that was previously created from the data downloaded; the #' data for 2016-01-01 to present are pulled from an XML feed from the US #' Treasury accessed in real time. #' @@ -50,9 +49,16 @@ #' #' Y30 1977-02-15 #' -#' #@param no parameters #' @return \code{data.frame} containing daily rates from 1962 to the #' most-recently completed business day. +#' @references +#' Static Data +#' +#' \url{http://www.federalreserve.gov/datadownload/Choose.aspx?rel=H15} +#' +#' XML Data +#' +#' \url{http://data.treasury.gov/feed.svc/DailyTreasuryYieldCurveRateData} #' @examples #' all_data <- USTreasuryRates() #' head(all_data) diff --git a/man/APY.Rd b/man/APY.Rd index 2b996ec..8433a00 100644 --- a/man/APY.Rd +++ b/man/APY.Rd @@ -27,4 +27,9 @@ APY(CMT, percent=TRUE) #> [1] 0.08024842 0.08076816 0.08066420 0.08076816 0.08076816 0.08076816 } +\references{ +Interest Rates - Frequently Asked Questions + +\url{https://www.treasury.gov/resource-center/faqs/Interest-Rates/Pages/faq.aspx#2} +} diff --git a/man/USTreasuryRates.Rd b/man/USTreasuryRates.Rd index bce0bec..f7ac605 100644 --- a/man/USTreasuryRates.Rd +++ b/man/USTreasuryRates.Rd @@ -12,8 +12,7 @@ USTreasuryRates() } \description{ For the dates 1962-01-02 to 2015-12-31 the data is retrieved from a static -file that was previously created from the data downloaded from -\url{http://www.federalreserve.gov/datadownload/Choose.aspx?rel=H15}; the +file that was previously created from the data downloaded; the data for 2016-01-01 to present are pulled from an XML feed from the US Treasury accessed in real time. } @@ -63,12 +62,19 @@ Treasury accessed in real time. Y20 1993-10-01 Y30 1977-02-15 - -#@param no parameters } \examples{ all_data <- USTreasuryRates() head(all_data) } +\references{ +Static Data + + \url{http://www.federalreserve.gov/datadownload/Choose.aspx?rel=H15} + + XML Data + + \url{http://data.treasury.gov/feed.svc/DailyTreasuryYieldCurveRateData} +}