Skip to content
All library documents

Finding Treasury Yield Data for R Analysis

Article Quant Q&A · Author: natorro

Summary

The document answers how to obtain interest-rate and Treasury yield data for analysis in R. It points to the Federal Reserve Bank of St. Louis economic database, which provides many rate series and can be accessed through the quantmod package. The example describes retrieving a named series from that source in the same way as other supported financial time series.

It also suggests the Federal Reserve’s H.15 release as a source for daily rates and historical data. For R package alternatives, it names YieldCurve and FRBData: the former offers some interest-rate series but may not be current, while the latter can retrieve various recently published Federal Reserve rates. The answers provide data-source options rather than a comparison of coverage, update schedules, licensing, or series definitions. Analysts still need to confirm that the chosen series matches their intended Treasury maturity, frequency, and historical window.

Key ideas

  • The St. Louis Fed economic database offers a broad collection of interest-rate time series accessible from R.
  • The quantmod package can retrieve database series through its supported data-source interface.
  • The Federal Reserve H.15 release is another source for daily and historical interest-rate observations.
  • YieldCurve and FRBData provide alternative R package routes to interest-rate data.
  • The listed sources may differ in recency and coverage, so users should check series details before analysis.

Tags

Full text
# Treasury Bond Yield Curves in R


# Treasury Bond Yield Curves in R












Does anyone know if I can access interest rates series from the treasury using R? I tried yahoo! Finance and it doesn't seem to have this kind of information.

## Answer by Alexey Kalmykov (score 6, accepted)

https://quant.stackexchange.com/a/4646

Quantmod package claims to support downloading data from Federal Reserve Bank of St. Louis Economic database, which contains plenty of rates time series. It should be pretty simple to get them into R using function `getSymbols`, in the same manner as

```
getSymbols("DEXJPUS",src="FRED") # FX rates from FRED
```

## Answer by Foster Boondoggle (score 3)

https://quant.stackexchange.com/a/4644

Try the Fed's H15 series. Daily data is here, with links to historical: http://www.federalreserve.gov/releases/h15/update/

## Answer by Ryogi (score 3)

https://quant.stackexchange.com/a/4645

There are some interest rates accessible through the R package YieldCurve. I don't think they contain the latest available interest rates.

Another alternative is the package FRBData. Using the function `GetInterestRates` you can download various of the latest interest rates published by the FRB.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.