Skip to contents

Returns the provenance list attached to an obr_tbl: the OBR publication it came from, the publication vintage, the source URL, retrieval time, file fingerprint, and package version.

Usage

obr_provenance(x)

Arguments

x

An obr_tbl (or any object; returns NULL if none attached).

Value

A named list of provenance fields, or NULL if no provenance is attached. Fields:

publication

Short code: "PFD", "HFD", "EFO", "WTR", "FSR", "PMD".

vintage

Publication vintage label, e.g. "March 2026".

source_url

Canonical OBR download URL the data came from.

retrieved

POSIXct timestamp of when the file was downloaded or last validated in the cache.

file_md5

MD5 fingerprint of the underlying spreadsheet.

package_version

obr package version that produced the object.

notes

Optional free-text notes, or NULL.

Examples

# \donttest{
op <- options(obr.cache_dir = tempdir())
psnb <- get_psnb()
#>  Loading from cache. Use `refresh = TRUE` to re-download.
obr_provenance(psnb)
#> $publication
#> [1] "PFD"
#> 
#> $vintage
#> [1] NA
#> 
#> $source_url
#> [1] "https://obr.uk/download/public-finances-databank/"
#> 
#> $retrieved
#> [1] "2026-05-07 21:08:38 UTC"
#> 
#> $file_md5
#> [1] "77a07b6641ca8ef85449de08077a9b87"
#> 
#> $package_version
#> [1] "0.5.0"
#> 
#> $notes
#> NULL
#> 
options(op)
# }