1
- # ' Download Treasury Yield Curve Rates
1
+ # ' Download treasury yield curve rates
2
2
# '
3
- # ' @param x `character(1)`. Defaults to `"hqm"`. One of :
3
+ # ' @param x `character(1)`. Must be one of the following options :
4
4
# ' * `"hqm"`: The Treasury High Quality Market (HQM) Corporate Bond Yield Curve.
5
5
# ' * `"tnc"`: The Treasury Nominal Coupon-Issue (TNC) Yield Curve.
6
6
# ' * `"trc"`: The Treasury Real Coupon-Issue (TRC) Yield Curve.
12
12
# ' @returns
13
13
# ' A `data.frame()` with the following columns: `yearmonth`, `maturity`, `rate`.
14
14
# ' @family yield curve
15
- # ' @source <https://home.treasury.gov/data/treasury-coupon-issues-and-corporate-bond-yield-curve/corporate-bond-yield-curve >
15
+ # ' @source <https://home.treasury.gov/data/treasury-coupon-issues-and-corporate-bond-yield-curves >
16
16
# ' @export
17
17
# ' @examples
18
18
# ' \dontrun{
19
- # ' tr_curve_rates ("tbi")
20
- # ' tr_curve_rates ("trc", "end-of-month", 2024L)
19
+ # ' tr_curve_rate ("tbi")
20
+ # ' tr_curve_rate ("trc", "end-of-month", 2024L)
21
21
# ' }
22
- tr_curve_rates <- function (x = c(" hqm" , " tnc" , " trc" , " tbi" ),
23
- type = c(" monthly" , " end-of-month" ),
24
- year = NULL ) {
22
+ tr_curve_rate <- function (x = c(" hqm" , " tnc" , " trc" , " tbi" ),
23
+ type = c(" monthly" , " end-of-month" ),
24
+ year = NULL ) {
25
25
stopifnot(is_count_or_null(year ))
26
26
x <- match.arg(x )
27
27
type <- match.arg(type )
@@ -71,7 +71,7 @@ tr_curve_rates <- function(x = c("hqm", "tnc", "trc", "tbi"),
71
71
do.call(rbind , res )
72
72
}
73
73
74
- # ' @rdname tr_curve_rates
74
+ # ' @rdname tr_curve_rate
75
75
# ' @export
76
76
tr_par_yields <- function (x = c(" hqm" , " tnc" , " trc" ),
77
77
type = c(" monthly" , " end-of-month" )) {
@@ -97,7 +97,7 @@ tr_par_yields <- function(x = c("hqm", "tnc", "trc"),
97
97
download_data(x , nms , 6L , " maturity" , " par_yield" )
98
98
}
99
99
100
- # ' @rdname tr_curve_rates
100
+ # ' @rdname tr_curve_rate
101
101
# ' @export
102
102
tr_forward_rate <- function (x = c(" tnc" , " trc" , " tbi" ),
103
103
type = c(" monthly" , " end-of-month" )) {
0 commit comments