% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/boe_curve_panel.R
\name{boe_curve_panel}
\alias{boe_curve_panel}
\title{Wide panel of BoE yield curve at chosen pillar maturities}
\usage{
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
)
}
\arguments{
\item{curve}{Character. Which curve to fetch. One of \code{"nominal"},
\code{"real"}, \code{"inflation"}, \code{"ois"}, or \code{"blc"}. Defaults to
\code{"nominal"}. The commercial bank liability curve (\code{"blc"}) is only
published in the historical archive zip, so requests for it always
route through the archive path regardless of \code{from} / \code{to}.}

\item{measure}{Character. \code{"spot"} (default) or \code{"forward"}.}

\item{segment}{Character. \code{"standard"} (default) for the full maturity
spectrum in half-year steps, or \code{"short"} for the separately fitted
short end in monthly steps (one month to five years).}

\item{frequency}{Character. \code{"daily"} (default) or \code{"monthly"}. Monthly
archives are end-of-month observations and are much smaller files.}

\item{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.}

\item{maturities}{Numeric vector of pillar maturities in years. When
\code{NULL} (default) a sensible set is chosen for the segment:
\code{c(0.5, 1, 2, 5, 10, 20)} for \code{"standard"} and
\code{c(0.5, 1, 2, 3, 5)} for \code{"short"}. Pillars not on the published grid
for the chosen curve and segment are dropped with a warning.}

\item{cache}{Logical. Use cached download if available and within the
TTL window (default \code{TRUE}).}

\item{cache_ttl_h}{Numeric. Cache time-to-live in hours. When \code{NULL}
(default) the TTL is 24 hours for the latest-month zip and 720 hours
(30 days) for archive zips.}
}
\value{
A \code{boe_tbl} data frame with columns \code{date} and one numeric
column per pillar named like \code{m0.5}, \code{m1}, \code{m2}, \code{m5}, \code{m10}, \code{m20}.
}
\description{
Convenience wrapper around \code{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.
}
\details{
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
(\code{segment = "short"}) in monthly increments, so pillars at integer,
half-integer, or whole-month maturities align exactly.
}
\examples{
\donttest{
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)
}
}

\dontrun{
# 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))
}

}
\seealso{
Other interest rates: 
\code{\link{boe_bank_rate}()},
\code{\link{boe_curve}()},
\code{\link{boe_sonia}()},
\code{\link{boe_yield_curve}()}
}
\concept{interest rates}
