View source: R/boe_curve_panel.R
| boe_curve_panel | R Documentation |
Convenience wrapper around boe_curve() that returns a wide-format
panel: one row per date, one column per requested pillar maturity.
This is the form most users want for time-series modelling and quick
plotting.
boe_curve_panel(
curve = c("nominal", "real", "inflation", "ois", "blc"),
measure = c("spot", "forward"),
segment = c("standard", "short"),
frequency = c("daily", "monthly"),
from = NULL,
to = NULL,
maturities = NULL,
cache = TRUE,
cache_ttl_h = NULL
)
curve |
Character. Which curve to fetch. One of |
measure |
Character. |
segment |
Character. |
frequency |
Character. |
from, to |
Date or character ("YYYY-MM-DD"). Optional inclusive bounds. When either is set, the function uses the BoE archive zip (multi-decade history) and filters by date. |
maturities |
Numeric vector of pillar maturities in years. When
|
cache |
Logical. Use cached download if available and within the
TTL window (default |
cache_ttl_h |
Numeric. Cache time-to-live in hours. When |
For each requested pillar, the function picks the published maturity
closest to the request (within a 0.05-year tolerance) and uses that.
The standard grid steps in 0.5-year increments and the short-end grid
(segment = "short") in monthly increments, so pillars at integer,
half-integer, or whole-month maturities align exactly.
A boe_tbl data frame with columns date and one numeric
column per pillar named like m0.5, m1, m2, m5, m10, m20.
Other interest rates:
boe_bank_rate(),
boe_curve(),
boe_sonia(),
boe_yield_curve()
if (requireNamespace("readxl", quietly = TRUE)) {
op <- options(boe.cache_dir = tempdir())
# Latest month: wide panel at chosen pillar maturities
panel <- boe_curve_panel(curve = "nominal", measure = "spot",
maturities = c(2, 5, 10, 20))
head(panel)
options(op)
}
## Not run:
# Historical panel (multi-decade archive download; not run automatically)
hist <- boe_curve_panel(curve = "nominal", measure = "spot",
from = "2020-01-01", maturities = c(2, 5, 10, 20))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.