Downloads (and caches) the OBR Economic and Fiscal Outlook Detailed Forecast Tables - Aggregates file and returns the components of net borrowing (Table 6.5) in tidy long format.
Arguments
- refresh
Logical. If
TRUE, re-download even if a cached copy exists. Defaults toFALSE.- vintage
Optional EFO vintage label such as
"October 2024". If supplied, the function downloads the file for that specific EFO. IfNULL(the default), the function uses any vintage set viaobr_pin(), or falls back to the latest live EFO via the dynamic URL resolver. Seeobr_efo_vintages()for the full list of supported vintages.
Value
An obr_tbl with the standard v0.4.0 schema (columns:
period, period_type, series, metric_type, value, unit):
- period
Fiscal year being forecast, e.g.
"2025-26"(character)- period_type
Always
"fiscal_year"for this function (character)- series
Component name, e.g.
"Net borrowing"(character)- metric_type
Always
"level"for this function (character)- value
Projected value (numeric)
- unit
Always
"gbp_bn"for this function (character)
Details
Covers the five-year forecast horizon published at the most recent fiscal event. Key series include current receipts, current expenditure, depreciation, net investment, and net borrowing (PSNB). The exact vintage is recorded in the returned object's provenance attribute and visible in the printed header.
Examples
# \donttest{
op <- options(obr.cache_dir = tempdir())
try({
efo <- get_efo_fiscal()
efo[efo$series == "Net borrowing", ]
obr_provenance(efo)$vintage
# Pin to a specific EFO for reproducibility
october_2024 <- get_efo_fiscal(vintage = "October 2024")
})
#> ℹ Downloading efo_aggregates.xlsx from OBR...
#> ✔ Saved to cache.
#> ℹ Downloading efo_aggregates_october_2024.xlsx from OBR...
#> ✔ Saved to cache.
options(op)
# }