Skip to contents

Returns the provenance list attached to a result from any hmrc_* data fetcher: source URL, attachment URL, the GOV.UK publication timestamp of the edition (published_at), 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 hmrc_* data function.

Value

A named list, or NULL if x has no metadata.

Examples

# \donttest{
op <- options(hmrc.cache_dir = file.path(tempdir(), "hmrc"))
try({
  tr <- hmrc_tax_receipts(tax = "vat", start = "2024-01")
  hmrc_meta(tr)
})
#>  Resolving download URL from GOV.UK Content API
#>  Resolving download URL from GOV.UK Content API [119ms]
#> 
#>  Downloading data file
#>  Downloading data file [600ms]
#> 
#>  Parsing data
#>  Parsing data [138ms]
#> 
#> $dataset
#> [1] "tax_receipts_monthly"
#> 
#> $hmrc_publication
#> [1] "HMRC tax receipts and NICs (monthly bulletin)"
#> 
#> $source_url
#> [1] "https://www.gov.uk/government/statistics/hmrc-tax-and-nics-receipts-for-the-uk"
#> 
#> $attachment_url
#> [1] "https://assets.publishing.service.gov.uk/media/6a82f19d3be22055c1aaa3ba/NS_Table.ods"
#> 
#> $slug
#> [1] "hmrc-tax-and-nics-receipts-for-the-uk"
#> 
#> $cell_methods
#> [1] "cash"
#> 
#> $frequency
#> [1] "monthly"
#> 
#> $vintage_date
#> [1] NA
#> 
#> $published_at
#> [1] "2026-08-21 06:00:03 UTC"
#> 
#> $fetched_at
#> [1] "2026-09-13 19:24:21 UTC"
#> 
#> $package_version
#> [1] "0.4.1"
#> 
options(op)
# }