Downloads and tidies HMRC Table 1 of the Capital Gains Tax statistics bulletin: estimated number of CGT taxpayers, amounts of gains, and tax liabilities by year of disposal. Data runs from 1987-88 onwards and is published annually each summer.
Arguments
- tax_year
Character vector or
NULL(default = all years). Filter to specific tax years, e.g."2022-23".- measure
Character vector or
NULL(default = all measures). Valid values:"taxpayers_total_thousands","taxpayers_individuals_thousands","taxpayers_trusts_thousands","males_pct","females_pct","gains_individuals_gbp_m","gains_trusts_gbp_m","gains_total_gbp_m","tax_individuals_gbp_m","tax_trusts_gbp_m","tax_total_gbp_m".- cache
Logical. Use cached file if available (default
TRUE).
Value
An hmrc_tbl (long format) with columns tax_year, measure,
value, and status ("provisional" for the years HMRC marks as
provisional, otherwise NA). Numbers of taxpayers are in thousands;
amounts in millions of pounds; percentages in per cent. Suppressed
cells return NA.
Details
Gains are after the deduction of taper relief and losses plus attributed gains, but before deduction of the Annual Exempt Amount. Trusts include personal representatives of the deceased. Statistics for the latest tax years are provisional and are revised in subsequent publications as late returns arrive.
Examples
# \donttest{
op <- options(hmrc.cache_dir = file.path(tempdir(), "hmrc"))
try({
cgt <- hmrc_capital_gains(measure = "tax_total_gbp_m")
tail(cgt)
})
#> ℹ Resolving download URL from GOV.UK Content API
#> ✔ Resolving download URL from GOV.UK Content API [249ms]
#>
#> ℹ Downloading data file
#> ✔ Downloading data file [198ms]
#>
#> ℹ Parsing data
#> ✔ Parsing data [44ms]
#>
#> # Capital Gains Tax statistics (Table 1)
#> # Source: https://www.gov.uk/government/statistics/capital-gains-tax-statistics
#> # Fetched 2026-09-13 19:24:13 UTC | Vintage: latest | Cells: liabilities | Freq: annual | 6 rows x 4 cols
#>
#> tax_year measure value status
#> 33 2019-20 tax_total_gbp_m 10095 <NA>
#> 34 2020-21 tax_total_gbp_m 14561 <NA>
#> 35 2021-22 tax_total_gbp_m 17035 <NA>
#> 36 2022-23 tax_total_gbp_m 14681 provisional
#> 37 2023-24 tax_total_gbp_m 12773 provisional
#> 38 2024-25 tax_total_gbp_m 24169 provisional
options(op)
# }