bondyields
is a simple package: it downloads treasury bill and bond yields data from the Bank of Canada website.
Quandl
does the same thing and is more comprehensive.
But with bondyields
, the main advantages are twofold:
- No limit to api calls (50 a day without an authentication token with Quandl
).
- Live feed (data is up to date with the website).
Get it with:
devtools::install_github("vathymut/bondyields")
The package is not available on CRAN. Neither do I intend to make it so.
To download yield curve data for Canada, use:
# Download
yields_ca <- bondyields::download_yields( )
# Set column date as key to the data.table
yields_ca <- yields_ca[ , dates := lubridate::ymd( dates ) ]
data.table::setkey( yields_ca, 'dates' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.