get_yields | R Documentation |
Load data from FRED
get_yields(
series = "DGS10",
na_locf = TRUE,
percent_adjust = TRUE,
format_out = "xts",
...
)
series |
The series code as found on https://fred.stlouisfed.org/, see details |
na_locf |
replace NA's with last observation |
percent_adjust |
divide raw data by 100 |
format_out |
xts or tibble |
... |
Additional parameters handed to quantmod::getSymbols |
The function is a wrapper for quantmod::getSymbols().
Commonly used constant-maturity yield series are:
DGS1MO: 1-Month Treasury Constant Maturity Rate
DGS3MO: 3-Month Treasury Constant Maturity Rate
DGS6MO: 6-Month Treasury Constant Maturity Rate
DGS1: 1-Year Treasury Constant Maturity Rate
DGS2: 2-Year Treasury Constant Maturity Rate
DGS3: 3-Year Treasury Constant Maturity Rate
DGS5: 5-Year Treasury Constant Maturity Rate
DGS7: 7-Year Treasury Constant Maturity Rate
DGS10: 10-Year Treasury Constant Maturity Rate
DGS20: 20-Year Treasury Constant Maturity Rate
DGS30: 30-Year Treasury Constant Maturity Rate
The yields data as an xts object
# US 1-Month yields
yields_us_1m <- get_yields(series = "DGS1MO")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.