Skip to contents

Downloads (and caches) the OBR Welfare Trends Report charts and tables workbook and returns the combined incapacity benefit caseload since 2008-09, in both absolute terms (thousands of claimants) and as a share of the working-age population.

Usage

get_incapacity_caseloads(refresh = FALSE)

Arguments

refresh

Logical. If TRUE, re-download even if a cached copy exists. Defaults to FALSE.

Value

An obr_tbl with the standard v0.4.0 schema. The two series ("Claimants" and "Share of working age population") carry different units: claimants are in thousands and the share is a percentage. After calling, the caller may want to overwrite unit to "count_k" for the claimants series, since the heuristic classifier cannot infer the "thousands" denomination from the series name alone.

Examples

# \donttest{
op <- options(obr.cache_dir = tempdir())
try({
  cases <- get_incapacity_caseloads()
  cases[cases$series == "Claimants", ]
})
#> Waiting 2s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  
#> Waiting 4s for retry backoff ■■■■■■■■■■■■■■■■■               
#> Waiting 4s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  
#> Warning: Could not resolve a current Welfare Trends Report (October 2024) URL from 1
#> candidate.
#> ℹ Falling back to
#>   <https://obr.uk/download/welfare-trends-report-october-2024-charts-and-tables/>.
#> ! Returned data may be older than expected. Run with internet access, or pin a
#>   vintage explicitly when that feature ships.
#> ℹ Downloading
#>   welfare_trends_october_2024__welfare-trends-report-october-2024-charts-and-tables.xlsx
#>   from OBR...
#> Waiting 4s for retry backoff ■■■■■■■■                        
#> Waiting 4s for retry backoff ■■■■■■■■■■■■■■■■                
#> Waiting 4s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  
#> Error : Failed to download
#> <https://obr.uk/download/welfare-trends-report-october-2024-charts-and-tables/>.
#> ✖ HTTP 403 Forbidden.
options(op)
# }