Data in each version is broken down by dimensions, and a unique combination of dimension options in a version can be used to retrieve observation level data.

ons_dim(id = NULL, edition = NULL, version = NULL)

ons_dim_opts(
  id = NULL,
  edition = NULL,
  version = NULL,
  dimension = NULL,
  limit = NULL,
  offset = NULL
)

ons_meta(id = NULL, edition = NULL, version = NULL)

Arguments

id

[character] Id that represents a dataset.

edition

[character] A subset of the dataset representing a specific time period. For some datasets this edition can contain all time periods (all historical data). The latest version of this is displayed by default.

version

[character] A specific instance of the edition at a point in time. New versions can be published as a result of corrections, revisions or new data becoming available.

dimension

[character]

limit

[numeric(1): NULL] Number of records to return. By default is NULL, which means that the defaults of the ONS API are used. You can set it to a number to request more (or less) records, and also to Inf to request all records.

offset

[numeric(1): NULL] The position in the dataset of a particular record. By specifying offset , you retrieve a subset of records starting with the offset value. Offset normally works with length , which determines how many records to retrieve starting from the offset.

Value

A character vector.

Examples

ons_dim(id = "cpih01")
#> [1] "aggregate" "geography" "time"     

ons_dim_opts(id = "cpih01", dimension = "time")
#> Fetched 20/408 (limit = 20, offset = 0) 
#>  [1] "Dec-21" "Nov-21" "Oct-21" "Sep-21" "Aug-21" "Jul-21" "Jun-21" "May-21"
#>  [9] "Apr-21" "Mar-21" "Feb-21" "Jan-21" "Dec-20" "Nov-20" "Oct-20" "Sep-20"
#> [17] "Aug-20" "Jul-20" "Jun-20" "May-20"

ons_meta(id = "cpih01")
#> $`@context`
#> [1] "https://cdn.ons.gov.uk/assets/json-ld/context.json"
#> 
#> $alerts
#> list()
#> 
#> $contacts
#>            email                           name          telephone
#> 1 cpi@ons.gov.uk Chris Payne and Philip Gooding +44 (0)1633 456900
#> 
#> $description
#> [1] "CPIH is the most comprehensive measure of inflation. It extends CPI to include a measure of the costs associated with owning, maintaining and living in one's own home, known as owner occupiers' housing costs (OOH), along with council tax. This dataset provides CPIH time series (2005 to latest published month), allowing users to customise their own selection, view or download."
#> 
#> $dimensions
#>                                                       href             id
#> 1         https://api.beta.ons.gov.uk/v1/code-lists/mmm-yy         mmm-yy
#> 2        https://api.beta.ons.gov.uk/v1/code-lists/uk-only        uk-only
#> 3 https://api.beta.ons.gov.uk/v1/code-lists/cpih1dim1aggid cpih1dim1aggid
#>       label      name
#> 1      Time      time
#> 2 Geography geography
#> 3 Aggregate aggregate
#> 
#> $distribution
#> [1] "json" "csv"  "csvw" "xls" 
#> 
#> $downloads
#> $downloads$csv
#> $downloads$csv$href
#> [1] "https://download.beta.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/18.csv"
#> 
#> $downloads$csv$size
#> [1] "4193787"
#> 
#> 
#> $downloads$csvw
#> $downloads$csvw$href
#> [1] "https://download.beta.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/18.csv-metadata.json"
#> 
#> $downloads$csvw$size
#> [1] "1610"
#> 
#> 
#> $downloads$xls
#> $downloads$xls$href
#> [1] "https://download.beta.ons.gov.uk/downloads/datasets/cpih01/editions/time-series/versions/18.xlsx"
#> 
#> $downloads$xls$size
#> [1] "251180"
#> 
#> 
#> 
#> $keywords
#> [1] "Inflation"
#> 
#> $license
#> [1] "Open Government Licence v3.0"
#> 
#> $links
#> $links$self
#> $links$self$href
#> [1] "https://api.beta.ons.gov.uk/v1/datasets/cpih01/editions/time-series/versions/18/metadata"
#> 
#> 
#> $links$version
#> $links$version$href
#> [1] "https://api.beta.ons.gov.uk/v1/datasets/cpih01/editions/time-series/versions/18"
#> 
#> $links$version$id
#> [1] "18"
#> 
#> 
#> $links$website_version
#> $links$website_version$href
#> [1] "https://api.beta.ons.gov.uk/v1/datasets/cpih01/editions/time-series/versions/18"
#> 
#> 
#> 
#> $methodologies
#>                                                                                                                                                  href
#> 1                                      https://www.ons.gov.uk/economy/inflationandpriceindices/methodologies/consumerpricesindicestechnicalmanual2019
#> 2 https://www.ons.gov.uk/file?uri=/economy/inflationandpriceindices/datasets/consumerpriceinflation/current/cpirereferenceddata2015100tcm77432809.xls
#> 3                                https://www.ons.gov.uk/economy/inflationandpriceindices/methodologies/usersandusesofconsumerpriceinflationstatistics
#>                                                    title
#> 1   Consumer Price Indices Technical Manual 2019 Edition
#> 2 Re-referencing of the CPI and CPIH indices to 2015=100
#> 3  Users and uses of consumer price inflation statistics
#>                                                                                                                                              description
#> 1                                                                                                                                                   <NA>
#> 2 From the release of January consumer price inflation data on 16 February 2016, CPI and CPIH indices will be re-referenced and published with 2015=100.
#> 3                        Provides information on the characteristics of the different measures of consumer price inflation in relation to potential use.
#> 
#> $national_statistic
#> [1] TRUE
#> 
#> $next_release
#> [1] "16 February 2022"
#> 
#> $publications
#>                                                                                              href
#> 1 https://www.ons.gov.uk/economy/inflationandpriceindices/bulletins/consumerpriceinflation/latest
#>                         title
#> 1 UK consumer price inflation
#> 
#> $qmi
#> $qmi$href
#> [1] "https://www.ons.gov.uk/economy/inflationandpriceindices/methodologies/consumerpriceinflationincludesall3indicescpihcpiandrpiqmi"
#> 
#> 
#> $related_datasets
#>                                                                                      href
#> 1 https://www.ons.gov.uk/economy/inflationandpriceindices/datasets/consumerpriceinflation
#>                      title
#> 1 Consumer price inflation
#> 
#> $release_date
#> [1] "2022-01-19T00:00:00.000Z"
#> 
#> $release_frequency
#> [1] "Monthly"
#> 
#> $title
#> [1] "Consumer Prices Index including owner occupiers' housing costs (CPIH)"
#> 
#> $unit_of_measure
#> [1] "Index: 2015=100"
#> 
#> $usage_notes
#> list()
#>