get_yields: Load data from FRED

View source: R/get_yields.R

get_yieldsR Documentation

Load data from FRED

Description

Load data from FRED

Usage

get_yields(
  series = "DGS10",
  na_locf = TRUE,
  percent_adjust = TRUE,
  format_out = "xts",
  ...
)

Arguments

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

Details

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

Value

The yields data as an xts object

Examples

# US 1-Month yields
yields_us_1m <- get_yields(series = "DGS1MO")

treasuryTR documentation built on April 3, 2023, 5:39 p.m.