% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hmrc_tax_receipts.R
\name{hmrc_tax_receipts}
\alias{hmrc_tax_receipts}
\title{Download HMRC tax receipts and National Insurance contributions}
\source{
\url{https://www.gov.uk/government/statistics/hmrc-tax-and-nics-receipts-for-the-uk}
}
\usage{
hmrc_tax_receipts(tax = NULL, start = NULL, end = NULL, cache = TRUE)
}
\arguments{
\item{tax}{Character vector of tax head identifiers, or \code{NULL} (default)
to return all available series. Use \code{\link[=hmrc_list_tax_heads]{hmrc_list_tax_heads()}} to see valid
values and descriptions.}

\item{start}{Character \code{"YYYY-MM"} or a \code{Date} object. If provided, rows
before this month are dropped.}

\item{end}{Character \code{"YYYY-MM"} or a \code{Date} object. If provided, rows
after this month are dropped.}

\item{cache}{Logical. If \code{TRUE} (default), the downloaded file is cached
locally and reused on subsequent calls. Use \code{\link[=hmrc_clear_cache]{hmrc_clear_cache()}} to
reset.}
}
\value{
An \code{hmrc_tbl} (subclass of \code{data.frame}) with columns:
\describe{
\item{date}{\code{Date}. The first day of the reference month.}
\item{tax_head}{Character. Tax or duty identifier (see
\code{\link[=hmrc_list_tax_heads]{hmrc_list_tax_heads()}}).}
\item{description}{Character. Plain-English series label.}
\item{receipts_gbp_m}{Numeric. Cash receipts in millions of pounds (GBP).}
}
Provenance metadata (source URL, fetch time, vintage) is attached as
the \code{"hmrc_meta"} attribute and can be inspected with \code{\link[=hmrc_meta]{hmrc_meta()}}.
}
\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.
}
\examples{
\donttest{
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)
}

}
\seealso{
Other data fetchers: 
\code{\link{hmrc_capital_gains}()},
\code{\link{hmrc_corporation_tax}()},
\code{\link{hmrc_creative_industries}()},
\code{\link{hmrc_fuel_duties}()},
\code{\link{hmrc_income_tax_stats}()},
\code{\link{hmrc_inheritance_tax}()},
\code{\link{hmrc_patent_box}()},
\code{\link{hmrc_property_transactions}()},
\code{\link{hmrc_rd_credits}()},
\code{\link{hmrc_stamp_duty}()},
\code{\link{hmrc_tax_gap}()},
\code{\link{hmrc_tobacco_duties}()},
\code{\link{hmrc_vat}()}
}
\concept{data fetchers}
