The hmrc package provides tidy access to statistical
data published by HM Revenue and Customs (HMRC) on GOV.UK. All functions
resolve download URLs at runtime via the GOV.UK Content API and cache
files locally between sessions. Every result is returned as an
hmrc_tbl, a subclass of data.frame carrying
provenance metadata (source URL, fetch time, vintage, cell methods) for
reproducible fiscal research.
hmrc_search() searches the dataset catalogue by keyword.
hmrc_publications() returns a tidy index of implemented and
planned datasets.
hmrc_tax_receipts() downloads the monthly HMRC Tax
Receipts and National Insurance Contributions bulletin, covering 41 tax
heads from April 2008 to the most recent published month.
# All 41 tax heads
receipts <- hmrc_tax_receipts()
head(receipts)
#> date tax_head description receipts_gbp_m
#> 2016-04-01 income_tax Income Tax (PAYE... 17423
#> 2016-05-01 income_tax Income Tax (PAYE... 11847Use hmrc_list_tax_heads() to see all available
identifiers without downloading data:
Filter to specific heads and date ranges:
Inspect the provenance metadata on any result:
hmrc_meta(big_three)
#> $dataset
#> [1] "tax_receipts_monthly"
#> $source_url
#> [1] "https://www.gov.uk/government/statistics/hmrc-tax-and-nics-receipts-for-the-uk"
#> $cell_methods
#> [1] "cash"
#> $frequency
#> [1] "monthly"
#> $fetched_at
#> [1] "2026-04-26 09:00:00 UTC"library(ggplot2)
ggplot(big_three, aes(x = date, y = receipts_gbp_m / 1000, colour = description)) +
geom_line(linewidth = 0.8) +
scale_y_continuous(labels = scales::label_comma(suffix = "bn")) +
labs(
title = "UK monthly tax receipts",
x = NULL,
y = "GBP billions",
colour = NULL,
caption = "Source: HMRC Tax Receipts and NICs bulletin"
) +
theme_minimal(base_size = 12) +
theme(legend.position = "bottom")hmrc_vat() covers monthly VAT receipts from April 1973,
broken into payments, repayments, import VAT, and home VAT.
hmrc_fuel_duties() covers monthly hydrocarbon oil duty
receipts from January 1990, broken down into petrol, diesel, other, and
total.
hmrc_tobacco_duties() covers monthly tobacco duty
receipts from January 1991, by product: cigarettes, cigars, hand-rolling
tobacco, other, and total.
hmrc_corporation_tax() returns annual Corporation Tax
receipts broken down by levy type: onshore CT, offshore CT, Bank Levy,
Bank Surcharge, Residential Property Developer Tax (RPDT), Energy
Profits Levy (EPL), and Electricity Generators Levy (EGL). Covers
2019-20 to the most recent financial year.
hmrc_stamp_duty() returns annual stamp duty receipts by
type from 2003-04: SDLT on property, SDLT on new leases, SDRT on shares,
and stamp duty on documents.
hmrc_rd_credits() returns annual statistics on R&D
tax credit claims and their cost by scheme (SME R&D Relief and RDEC)
from 2000-01.
hmrc_capital_gains() returns annual estimates of CGT
taxpayers, gains, and tax liabilities from 1987-88 (HMRC CGT Table
1).
hmrc_inheritance_tax() returns IHT estate counts, tax
due, average tax, and effective tax rates by net-estate band for the
latest published year of death (HMRC IHT Table 12.1a). The publication
carries a roughly three-year administrative lag.
hmrc_patent_box() returns the annual count of companies
electing into the Patent Box and total relief claimed (HMRC Patent Box
Table 1) from 2013-14 onwards.
hmrc_creative_industries() returns annual reliefs across
the eight creative industries reliefs (film, high-end TV, animation,
children’s TV, video games, theatre, orchestra, museums and
galleries).
hmrc_tax_gap() returns the most recent cross-sectional
tax gap estimates, broken down by tax type, taxpayer group, and
behaviour component (evasion, error, avoidance, etc.).
hmrc_income_tax_stats() returns annual Income Tax
liabilities by income range (HMRC Table 2.5), including taxpayer counts,
total income, tax liabilities, and average tax rates.
hmrc_property_transactions() returns monthly counts of
residential and non-residential property transactions by UK nation from
April 2005.
ggplot(prop, aes(x = date, y = transactions / 1000)) +
geom_line(colour = "#3B82F6", linewidth = 0.8) +
scale_y_continuous(labels = scales::label_comma(suffix = "k")) +
labs(
title = "UK residential property transactions",
x = NULL,
y = "Transactions (thousands)",
caption = "Source: HMRC Monthly Property Transactions bulletin"
) +
theme_minimal(base_size = 12)All downloads are cached locally in your user cache directory. Subsequent calls return the cached file instantly with no network request.
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.