| Title: | Download and Tidy 'HMRC' Statistical Data |
| Version: | 0.4.0 |
| Description: | Provides functions to download, parse, and tidy statistical data published by 'HM Revenue and Customs' ('HMRC') on 'GOV.UK'. Returns annotated 'hmrc_tbl' data frames with provenance metadata (source URL, fetch time, vintage, cell methods) for reproducible fiscal research. Covers monthly tax receipts (41 tax heads from 2008), 'VAT' (from 1973), fuel duties (from 1990), tobacco duties (from 1991), annual 'Corporation Tax' receipts, stamp duty, research and development tax credit statistics (from 2000), tax gap estimates, 'Income Tax' liabilities by income range, and monthly property transaction counts. File URLs are resolved at runtime via the 'GOV.UK' Content API https://www.gov.uk/api/content, so data is always current without hardcoded URLs. Files are cached locally between sessions. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Language: | en-GB |
| RoxygenNote: | 7.3.3 |
| Imports: | cli (≥ 3.6.0), httr2 (≥ 1.0.0), lifecycle (≥ 1.0.0), readODS (≥ 2.3.0), readxl (≥ 1.4.0), tools, utils |
| Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0), ggplot2, scales, withr |
| Config/testthat/edition: | 3 |
| VignetteBuilder: | knitr |
| URL: | https://charlescoverdale.github.io/hmrc/, https://github.com/charlescoverdale/hmrc |
| BugReports: | https://github.com/charlescoverdale/hmrc/issues |
| Depends: | R (≥ 4.1.0) |
| LazyData: | true |
| NeedsCompilation: | no |
| Packaged: | 2026-04-26 13:14:18 UTC; charlescoverdale |
| Author: | Charles Coverdale [aut, cre] |
| Maintainer: | Charles Coverdale <charlesfcoverdale@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-04-26 13:30:03 UTC |
hmrc: Download and Tidy HMRC Statistical Data
Description
Provides functions to download, parse, and tidy statistical data published
by HM Revenue and Customs (HMRC) on GOV.UK. Returns annotated hmrc_tbl
data frames with provenance metadata (source URL, fetch time, vintage,
cell methods) for reproducible fiscal research. File URLs are resolved at
runtime via the GOV.UK Content API, so data is always current.
Data fetchers
-
hmrc_tax_receipts()— monthly tax receipts and NICs (April 2008+) -
hmrc_property_transactions()— monthly property transactions (April 2005+) -
hmrc_income_tax_stats()— annual Income Tax liabilities by income range -
hmrc_tax_gap()— annual tax gap estimates by tax type -
hmrc_stamp_duty()— annual stamp duty receipts (SDLT, SDRT) -
hmrc_vat()— monthly VAT receipts breakdown (April 1973+) -
hmrc_rd_credits()— annual R&D tax credit statistics (2000-01+) -
hmrc_fuel_duties()— monthly fuel duty receipts (January 1990+) -
hmrc_tobacco_duties()— monthly tobacco duty receipts (January 1991+) -
hmrc_corporation_tax()— annual Corporation Tax receipts by type -
hmrc_capital_gains()— annual CGT taxpayers, gains, liabilities (1987-88+) -
hmrc_inheritance_tax()— IHT estates and liabilities by net-estate band -
hmrc_patent_box()— annual Patent Box election counts and relief -
hmrc_creative_industries()— annual Film/HETV/Games/Theatre/etc reliefs
Discovery and infrastructure
-
hmrc_search()— keyword search of the dataset catalogue -
hmrc_publications()— index of implemented + planned publications -
hmrc_list_tax_heads()— lookup table of tax-receipts identifiers -
hmrc_cache_info()— inspect locally cached files -
hmrc_clear_cache()— manage locally cached files -
hmrc_meta()— extract provenance metadata from anyhmrc_tblresult
Citation
Run citation("hmrc") for the structured citation, or see the
CITATION.cff file at the package root for the GitHub citation widget.
Data source
All data is published by HMRC on GOV.UK under the Open Government Licence. See https://www.gov.uk/government/organisations/hm-revenue-customs/about/statistics.
Author(s)
Maintainer: Charles Coverdale charlesfcoverdale@gmail.com
See Also
Useful links:
Report bugs at https://github.com/charlescoverdale/hmrc/issues
HMRC dataset catalogue
Description
A data frame describing every HMRC dataset known to the package, including
those exposed by an hmrc_* function and those on the development roadmap
(where function_name is NA). Use hmrc_search() for keyword search and
hmrc_publications() for a tidy index.
Usage
catalogue
Format
A data frame with columns:
- dataset
Character. Short identifier.
- publication
Character. GOV.UK publication name.
- function_name
Character. Exporting function (or
NA).- frequency
Character.
monthly,quarterly,annual, etc.- start
Character. First period of the published series.
- publisher
Character. Usually
"HMRC".- slug
Character. GOV.UK statistics slug.
- url
Character. URL of the publication landing page.
- description
Character. One-line description.
- tags
Character. Space-separated keywords searched by
hmrc_search().
Deprecated get_* aliases
Description
Renamed to use the hmrc_* prefix in v0.4.0. These aliases will be
removed in v0.6.0.
Usage
get_tax_receipts(...)
get_vat(...)
get_fuel_duties(...)
get_tobacco_duties(...)
get_corporation_tax(...)
get_stamp_duty(...)
get_property_transactions(...)
get_rd_credits(...)
get_tax_gap(...)
get_income_tax_stats(...)
list_tax_heads()
clear_cache(max_age_days = NULL)
Inspect the local HMRC cache
Description
Returns a tidy table of files currently held in the package cache, with
size and age. Useful for understanding what is stored locally and deciding
when to clear stale files via hmrc_clear_cache().
Usage
hmrc_cache_info()
Value
A data frame with columns file, extension, size_bytes,
size_mb, modified (POSIXct), age_days, path. The data frame is
empty (zero rows) if the cache directory does not exist or is empty.
The cache directory itself is attached as the attribute "cache_dir".
See Also
Other infrastructure:
hmrc_clear_cache(),
hmrc_list_tax_heads(),
hmrc_meta(),
hmrc_publications(),
hmrc_search()
Examples
op <- options(hmrc.cache_dir = tempdir())
info <- hmrc_cache_info()
attr(info, "cache_dir")
options(op)
Download HMRC Capital Gains Tax statistics
Description
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.
Usage
hmrc_capital_gains(tax_year = NULL, measure = NULL, cache = TRUE)
Arguments
tax_year |
Character vector or |
measure |
Character vector or |
cache |
Logical. Use cached file if available (default |
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 two tax years are provisional and are revised in subsequent publications as late returns arrive.
Value
An hmrc_tbl (long format) with columns tax_year, measure,
value. Numbers of taxpayers are in thousands; amounts in millions
of pounds; percentages in percent. Suppressed cells return NA.
Source
https://www.gov.uk/government/organisations/hm-revenue-customs/series/capital-gains-tax-statistics
See Also
Other data fetchers:
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_capital_gains()
hmrc_capital_gains(measure = "tax_total_gbp_m")
hmrc_capital_gains(tax_year = "2022-23")
options(op)
Clear the local HMRC data cache
Description
Deletes locally cached data files downloaded by the package. By default
all cached files are removed; pass max_age_days to remove only files
older than that.
Usage
hmrc_clear_cache(max_age_days = NULL)
Arguments
max_age_days |
Numeric or |
Value
Invisibly returns the number of files deleted.
See Also
Other infrastructure:
hmrc_cache_info(),
hmrc_list_tax_heads(),
hmrc_meta(),
hmrc_publications(),
hmrc_search()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_clear_cache()
hmrc_clear_cache(max_age_days = 30)
options(op)
Download HMRC Corporation Tax receipts by type
Description
Downloads and tidies the HMRC Corporation Tax Statistics annual publication, reporting receipts broken down by tax type for the most recent six financial years. Published annually in September.
Usage
hmrc_corporation_tax(cache = TRUE)
Arguments
cache |
Logical. Use cached file if available (default |
Details
Some levies (e.g. Residential Property Developer Tax, Electricity
Generators Levy) were introduced mid-series and have NA values for
earlier years.
Value
An hmrc_tbl with columns tax_year, type, description,
receipts_gbp_m.
Source
https://www.gov.uk/government/collections/analyses-of-corporation-tax-receipts-and-liabilities
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_corporation_tax()
options(op)
Download HMRC Creative Industries tax relief statistics
Description
Downloads and tidies Table 1 (annual time series) of the HMRC Creative Industries Statistics for each of the eight creative-industries reliefs: Film, High-end TV, Animation, Children's TV, Video Games, Theatre, Orchestra, and Museums and Galleries Exhibition. Published annually each August.
Usage
hmrc_creative_industries(sector = NULL, tax_year = NULL, cache = TRUE)
Arguments
sector |
Character vector or |
tax_year |
Character vector or |
cache |
Logical. Use cached file if available (default |
Details
Creative Industries reliefs are paid on an accruals basis. The latest
tax year in each sector's table is provisional and uplifted by HMRC for
claims not yet received; status is recorded in the status column.
Sector tables differ slightly in their column set (films track
productions, video games track productions, theatre tracks
claims/productions, museums track exhibitions, etc.); columns absent
from a sector's table are returned as NA.
Value
An hmrc_tbl with columns:
- sector
Character. Creative-industries sector identifier.
- tax_year
Character. Tax year, e.g.
"2023-24".- companies
Numeric. Number of companies (where reported).
- claims
Numeric. Number of claims (where reported).
- productions
Numeric. Number of productions (films, games, etc., where reported).
- relief_gbp_m
Numeric. Amount of relief paid, GBP million.
- status
Character. HMRC revision status (e.g.
"Unchanged","Provisional").
Source
https://www.gov.uk/government/collections/creative-industries-statistics
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_creative_industries(sector = "film")
hmrc_creative_industries(tax_year = "2023-24")
options(op)
Download HMRC hydrocarbon oil (fuel duty) receipts
Description
Downloads and tidies the HMRC Hydrocarbon Oils Bulletin, which reports monthly fuel duty receipts. Data runs from January 1990 to the most recent published month, updated twice per year (January and July).
Usage
hmrc_fuel_duties(fuel = NULL, start = NULL, end = NULL, cache = TRUE)
Arguments
fuel |
Character vector or |
start |
Character |
end |
Character |
cache |
Logical. Use cached file if available (default |
Value
An hmrc_tbl with columns date, fuel, description,
receipts_gbp_m.
Source
https://www.gov.uk/government/statistics/hydrocarbon-oils-bulletin
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_fuel_duties(fuel = "total", start = "2010-01")
hmrc_fuel_duties()
options(op)
Download HMRC Income Tax liabilities by income range
Description
Downloads and tidies HMRC Table 2.5, which reports the number of Income Tax payers and their liabilities grouped by total income range, for each available tax year. Numbers of taxpayers are in thousands; amounts are in millions of pounds unless otherwise noted. Published annually in May/June.
Usage
hmrc_income_tax_stats(tax_year = NULL, cache = TRUE)
Arguments
tax_year |
Character vector or |
cache |
Logical. Use cached file if available (default |
Details
The earliest tax year with outturn data is based on the Survey of Personal
Incomes; later years are projected estimates. Values suppressed for small
sample sizes are returned as NA.
Value
An hmrc_tbl with columns tax_year, income_range,
income_lower_gbp, taxpayers_thousands, total_income_gbp_m,
tax_liability_gbp_m, average_rate_pct, average_tax_gbp.
Source
https://www.gov.uk/government/statistics/income-tax-liabilities-by-income-range
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_income_tax_stats()
hmrc_income_tax_stats(tax_year = "2023-24")
options(op)
Download HMRC Inheritance Tax liabilities by estate band
Description
Downloads and tidies HMRC Table 12.1a of the Inheritance Tax Liabilities Statistics: numbers of estates, tax due, average tax, and average effective tax rate, broken down by net-estate band, for the latest published year of death. Published annually in July, ~3 years after the year of death due to the administration window.
Usage
hmrc_inheritance_tax(cache = TRUE)
Arguments
cache |
Logical. Use cached file if available (default |
Value
An hmrc_tbl (long format) with columns:
- tax_year
Character. Year of death, e.g.
"2022-23".- estate_band_lower_gbp
Numeric. Lower limit of the net-estate band in pounds.
- estate_band
Character. Plain-English label, e.g.
"GBP 0-100k","Total".- measure
Character. One of
"number_not_taxed","number_taxed","tax_due_gbp_m","avg_tax_gbp","effective_rate_pct".- value
Numeric. Value, with
[z](no tax due to NRB) and[c](disclosure suppression) returned asNA.
Source
https://www.gov.uk/government/statistics/inheritance-tax-liabilities-statistics
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_inheritance_tax()
options(op)
List available tax heads in the HMRC Tax Receipts bulletin
Description
Returns a data frame describing all tax and duty heads available in
hmrc_tax_receipts(). No network connection is required: the data is
bundled with the package.
Usage
hmrc_list_tax_heads()
Value
A data frame with columns:
- tax_head
Character. Identifier used in the
taxargument ofhmrc_tax_receipts().- description
Character. Plain-English description.
- category
Character. Broad grouping.
- available_from
Character. Earliest year of monthly data.
See Also
Other infrastructure:
hmrc_cache_info(),
hmrc_clear_cache(),
hmrc_meta(),
hmrc_publications(),
hmrc_search()
Examples
hmrc_list_tax_heads()
Provenance metadata of an hmrc_tbl
Description
Returns the provenance list attached to a result from any hmrc_* data
fetcher: source URL, fetch time, vintage, cell methods, and so on. Useful
for citation, audit trails, and reproducibility.
Usage
hmrc_meta(x)
Arguments
x |
An object returned by an |
Value
A named list, or NULL if x has no metadata.
See Also
Other infrastructure:
hmrc_cache_info(),
hmrc_clear_cache(),
hmrc_list_tax_heads(),
hmrc_publications(),
hmrc_search()
Examples
op <- options(hmrc.cache_dir = tempdir())
tr <- hmrc_tax_receipts(tax = "vat", start = "2024-01")
hmrc_meta(tr)
options(op)
Download HMRC Patent Box relief statistics
Description
Downloads and tidies Table 1 of the HMRC Patent Box Relief Statistics: annual number of companies electing into the Patent Box regime and the total relief claimed (in GBP million). The Patent Box was introduced from 1 April 2013; data runs from tax year 2013-14 to the most recent published year (typically with a one-year provisional lag). Published annually each September.
Usage
hmrc_patent_box(tax_year = NULL, cache = TRUE)
Arguments
tax_year |
Character vector or |
cache |
Logical. Use cached file if available (default |
Value
An hmrc_tbl with columns:
- tax_year
Character. Tax year, e.g.
"2023-24".- companies
Numeric. Number of companies electing into the regime (rounded to nearest 5 by HMRC).
- relief_gbp_m
Numeric. Total relief in millions of pounds.
Source
https://www.gov.uk/government/statistics/patent-box-reliefs-statistics
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_patent_box()
hmrc_patent_box(tax_year = "2022-23")
options(op)
Download monthly UK property transaction counts
Description
Downloads and tidies the HMRC Monthly Property Transactions bulletin, which counts residential and non-residential property transactions (SDLT returns, LBTT in Scotland, LTT in Wales) for England, Scotland, Wales, Northern Ireland, and the UK total. Data runs from April 2005 to the most recent completed month.
Usage
hmrc_property_transactions(
type = c("all", "residential", "non_residential"),
nation = NULL,
start = NULL,
end = NULL,
cache = TRUE
)
Arguments
type |
Character. One of |
nation |
Character vector or |
start |
Character |
end |
Character |
cache |
Logical. Use cached file if available (default |
Value
An hmrc_tbl with columns date, nation, type,
transactions.
Source
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_property_transactions()
hmrc_property_transactions(type = "residential", nation = "england",
start = "2020-01")
options(op)
Index of HMRC publications known to the package
Description
Tidy roster of HMRC publications, marking which are exposed via an
hmrc_* function and which are on the development roadmap. Useful for
planning analyses, citing the package, and tracking coverage over time.
Usage
hmrc_publications(status = c("all", "implemented", "planned"))
Arguments
status |
One of |
Value
A data frame with one row per publication and a status column
("implemented" or "planned").
See Also
Other infrastructure:
hmrc_cache_info(),
hmrc_clear_cache(),
hmrc_list_tax_heads(),
hmrc_meta(),
hmrc_search()
Examples
# Everything in the catalogue
hmrc_publications()
# Only roadmap items
hmrc_publications("planned")
Download HMRC R&D tax credit statistics
Description
Downloads and tidies the HMRC Research and Development Tax Credits Statistics publication, covering the SME R&D Relief and Research and Development Expenditure Credit (RDEC) schemes. Annual data runs from 2000-01 to the most recent financial year, published annually in September.
Usage
hmrc_rd_credits(scheme = NULL, measure = NULL, cache = TRUE)
Arguments
scheme |
Character vector or |
measure |
Character vector or |
cache |
Logical. Use cached file if available (default |
Details
Data before 2003-04 covers only the SME scheme (RDEC was introduced in 2002). Figures for the most recent two years are provisional and subject to revision as late claims are processed.
Value
An hmrc_tbl with columns tax_year, scheme, description,
measure, value.
Source
https://www.gov.uk/government/statistics/corporate-tax-research-and-development-tax-credit
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_rd_credits()
hmrc_rd_credits(scheme = "sme", measure = "claims")
options(op)
Search the HMRC dataset catalogue
Description
Fuzzy keyword search across publication name, description, tags, and dataset identifier. Returns a tidy table of matching rows so users can discover what the package exposes (and what is on the roadmap).
Usage
hmrc_search(query = NULL, implemented = NULL, frequency = NULL)
Arguments
query |
Character. Keyword or regex pattern. Case-insensitive.
Matches anywhere in |
implemented |
Logical or |
frequency |
Optional character vector to filter by frequency
(e.g. |
Value
A data frame, sorted with implemented datasets first.
See Also
Other infrastructure:
hmrc_cache_info(),
hmrc_clear_cache(),
hmrc_list_tax_heads(),
hmrc_meta(),
hmrc_publications()
Examples
# Everything mentioning VAT
hmrc_search("vat")
# Only annual publications already implemented
hmrc_search(implemented = TRUE, frequency = "annual")
# Roadmap items mentioning capital gains
hmrc_search("capital gains", implemented = FALSE)
Download HMRC stamp duty receipts
Description
Downloads and tidies the HMRC Annual Stamp Tax Statistics, covering Stamp Duty Land Tax (SDLT), Stamp Duty Reserve Tax (SDRT) on shares, and other stamp duties. Annual data from 2003-04 to the most recent financial year, published each December.
Usage
hmrc_stamp_duty(type = NULL, cache = TRUE)
Arguments
type |
Character vector or |
cache |
Logical. Use cached file if available (default |
Value
An hmrc_tbl with columns tax_year, type, description,
receipts_gbp_m (rounded to nearest GBP 5m by HMRC).
Source
https://www.gov.uk/government/statistics/uk-stamp-tax-statistics
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_stamp_duty()
hmrc_stamp_duty(type = "sdlt_total")
options(op)
Download HMRC tax gap estimates
Description
Downloads and tidies the HMRC Measuring the Tax Gap publication, which estimates the difference between the tax theoretically owed and the tax actually collected, broken down by tax type and taxpayer group. Published annually in June, covering the most recent financial year.
Usage
hmrc_tax_gap(tax = NULL, cache = TRUE)
Arguments
tax |
Character vector or |
cache |
Logical. Use cached file if available (default |
Details
The tax gap publication is cross-sectional: each edition covers a single financial year. This function returns data for the most recent edition available on GOV.UK. Historical estimates back to 2005-06 are available in a separate HMRC publication (Measuring the Tax Gap: Time Series).
Value
An hmrc_tbl with columns tax_year, tax, taxpayer_type,
component, gap_pct, gap_gbp_bn, uncertainty.
Source
https://www.gov.uk/government/statistics/measuring-tax-gaps
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_receipts(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_tax_gap()
hmrc_tax_gap(tax = "VAT")
options(op)
Download HMRC tax receipts and National Insurance contributions
Description
Downloads and tidies the monthly HMRC Tax Receipts and National Insurance Contributions bulletin published on GOV.UK. The bulletin covers all major UK taxes and duties from April 2008 to the most recent month (monthly granularity), updated on approximately the 15th working day of each month.
Usage
hmrc_tax_receipts(tax = NULL, start = NULL, end = NULL, cache = TRUE)
Arguments
tax |
Character vector of tax head identifiers, or |
start |
Character |
end |
Character |
cache |
Logical. If |
Value
An hmrc_tbl (subclass of data.frame) with columns:
- date
Date. The first day of the reference month.- tax_head
Character. Tax or duty identifier (see
hmrc_list_tax_heads()).- description
Character. Plain-English series label.
- receipts_gbp_m
Numeric. Cash receipts in millions of pounds (GBP).
Provenance metadata (source URL, fetch time, vintage) is attached as
the "hmrc_meta" attribute and can be inspected with hmrc_meta().
Source
https://www.gov.uk/government/statistics/hmrc-tax-and-nics-receipts-for-the-uk
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tobacco_duties(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_tax_receipts()
hmrc_tax_receipts(tax = c("income_tax", "vat"))
hmrc_tax_receipts(start = "2020-04")
hmrc_tax_receipts(tax = "vat", start = "2019-01", end = "2024-12")
options(op)
Download HMRC tobacco duty receipts
Description
Downloads and tidies the HMRC Tobacco Bulletin, which reports monthly tobacco products duty receipts by product type. Data runs from January 1991 to the most recent published month, updated twice per year (February and August).
Usage
hmrc_tobacco_duties(product = NULL, start = NULL, end = NULL, cache = TRUE)
Arguments
product |
Character vector or |
start |
Character |
end |
Character |
cache |
Logical. Use cached file if available (default |
Value
An hmrc_tbl with columns date, product, description,
receipts_gbp_m.
Source
https://www.gov.uk/government/statistics/tobacco-bulletin
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_vat()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_tobacco_duties(start = "2015-01")
hmrc_tobacco_duties(product = "cigarettes")
options(op)
Download HMRC VAT receipts
Description
Downloads and tidies the HMRC VAT Annual Statistics bulletin, which reports monthly VAT receipts broken down into payments, repayments, import VAT, and home VAT. Monthly data runs from April 1973; the bulletin is published annually (December).
Usage
hmrc_vat(measure = NULL, start = NULL, end = NULL, cache = TRUE)
Arguments
measure |
Character vector or |
start |
Character |
end |
Character |
cache |
Logical. Use cached file if available (default |
Details
Note that early years (pre-1985) have suppressed payment and repayment splits; only the total is available for those periods. From January 2021, import VAT collected via postponed VAT accounting is recorded within payments and repayments rather than the import VAT column.
Value
An hmrc_tbl with columns date, measure, description,
receipts_gbp_m. Repayments are negative.
Source
https://www.gov.uk/government/statistics/value-added-tax-vat-annual-statistics
See Also
Other data fetchers:
hmrc_capital_gains(),
hmrc_corporation_tax(),
hmrc_creative_industries(),
hmrc_fuel_duties(),
hmrc_income_tax_stats(),
hmrc_inheritance_tax(),
hmrc_patent_box(),
hmrc_property_transactions(),
hmrc_rd_credits(),
hmrc_stamp_duty(),
hmrc_tax_gap(),
hmrc_tax_receipts(),
hmrc_tobacco_duties()
Examples
op <- options(hmrc.cache_dir = tempdir())
hmrc_vat(measure = "total", start = "2010-01")
hmrc_vat(start = "2020-01")
options(op)
Tax head lookup table
Description
A data frame describing all tax and duty series available in
hmrc_tax_receipts().
Usage
tax_heads
Format
A data frame with 41 rows and 4 columns:
- tax_head
Character. Identifier used in the
taxargument ofhmrc_tax_receipts().- description
Character. Plain-English description.
- category
Character. Broad grouping:
"income","nics","consumption","property","environment","expenditure","other", or"total".- available_from
Character. Approximate start year of monthly data.
Source
Derived from the HMRC Tax Receipts and NICs bulletin. https://www.gov.uk/government/statistics/hmrc-tax-and-nics-receipts-for-the-uk