CMTrates: Download Constant-Maturity Treasury (CMT) rates

Description Usage Value data.frame format Starting Dates Author(s) References Examples

View source: R/download_rates.R

Description

For the dates 1962-01-02 to 2015-12-31 the data is retrieved from a static file that was previously created from the data downloaded; the data for 2016-01-01 to present are pulled from an XML feed from the US Treasury accessed in real time.

Usage

1

Value

data.frame containing daily rates from 1962 to the most-recently completed business day. The class has c("ustreasuries", "CMT") appended so that the data.frame can be identified by other functions.

data.frame format

The data.frame returned contains one row for every day, sorted in descending order by date. The columns are "Id", "NEW_DATE", "BC_1MONTH", "BC_3MONTH", "BC_6MONTH", "BC_1YEAR", "BC_2YEAR", "BC_3YEAR", "BC_5YEAR", "BC_7YEAR", "BC_10YEAR", "BC_20YEAR", "BC_30YEAR", "BC_30YEARDISPLAY".

"Id" is NA for the historical data; for the current data it is an integer returned in the XML feed. "NEW_DATE" is formatted as as.Date("1962-01-02"). All the other columns are numeric in "percentage" format: 7.12 means 7.12% or 0.0712.

Yields are missing for certain maturities on various dates: for example, in the 1990's, as a result of a budget surplus, certain bonds were retired.

The size of the data.frame downloaded on 2016-01-25 was 1,514,504 bytes.

Starting Dates

Different maturities have different starting dates:

M01 2001-07-31

M03 1982-01-04

M06 1982-01-04

Y01 1962-01-02

Y02 1976-06-01

Y03 1962-01-02

Y05 1962-01-02

Y07 1969-07-01

Y10 1962-01-02

Y20 1993-10-01

Y30 1977-02-15

Author(s)

George Fisher GeorgeRFisher@gmail.com

References

Static Data

http://www.federalreserve.gov/datadownload/Choose.aspx?rel=H15

XML Data

http://data.treasury.gov/feed.svc/DailyTreasuryYieldCurveRateData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
all_data <- CMTrates()
head(all_data, n=3L)
# =========================
# Above: the earliest dates
# =========================


tail(all_data)
# ============================
# Above: the most-recent dates
# ============================

grfiv/ustreasuries documentation built on May 17, 2019, 8:36 a.m.