https://github.com/dylanjm/yieldr
#rstats package that fetches treasury yield data from the US Treasury Department's website
https://github.com/dylanjm/yieldr
Last synced: over 1 year ago
JSON representation
#rstats package that fetches treasury yield data from the US Treasury Department's website
- Host: GitHub
- URL: https://github.com/dylanjm/yieldr
- Owner: dylanjm
- License: other
- Created: 2018-12-30T21:56:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-13T22:42:15.000Z (over 7 years ago)
- Last Synced: 2025-04-13T00:49:48.733Z (over 1 year ago)
- Language: R
- Size: 2.1 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yieldr 
[](https://travis-ci.com/dylanjm/yieldr)
[](http://www.repostatus.org/#active)
## Installation
You can install yieldr from github with:
``` r
# install.packages("devtools")
devtools::install_github("dylanjm/yieldr")
```
## Basic Usage
As of right now, the package only comes with one function:
`get_treasury_yields()`.
``` r
library(yieldr)
library(dplyr)
library(gganimate)
library(ggplot2)
treasury_dat <- get_treasury_yields(tidy = TRUE)
treasury_dat %>%
filter(!duration %in% c("BC_1MONTH",
"BC_2MONTH",
"BC_30YEARDISPLAY")) %>%
ggplot(aes(x = duration, y = rate, group = NEW_DATE)) +
geom_line() +
scale_x_discrete(labels = c("3M", "6M", "1Y", "2Y",
"3Y", "5Y", "7Y", "10Y", "20Y", "30Y")) +
labs(title = "Year: {frame_time}") +
transition_time(NEW_DATE)
```