Used to get details about codes and code lists stored by ONS. Codes are used to provide a common definition when presenting statistics with related categories. Codes are gathered in code lists, which may change over time to include new or different codes. The meaning of a code should not change over time, but new codes may be created where new meaning is required.

ons_codelists()

ons_codelist(code_id = NULL)

ons_codelist_editions(code_id = NULL)

ons_codelist_edition(code_id = NULL, edition = NULL)

Arguments

code_id

[character]. The id of a codelist.

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.

Value

A list or character vector.

Examples

# \donttest{
ons_codelists()
#>  [1] "administrative-geography"        "adzuna-jobs-category"           
#>  [3] "age-groups"                      "averages-and-percentiles"       
#>  [5] "build-status"                    "calendar-month"                 
#>  [7] "calendar-years"                  "cause-of-death"                 
#>  [9] "city-regions"                    "construction-classifications"   
#> [11] "construction-series-type"        "countries"                      
#> [13] "countries-and-territories"       "cpih1dim1aggid"                 
#> [15] "dd-mm"                           "decade"                         
#> [17] "economic-activity"               "england-regions"                
#> [19] "enterprise-regions"              "enterprises-and-local-units"    
#> [21] "financial-and-calendar-years"    "healthcare-financing-scheme"    
#> [23] "healthcare-function"             "healthcare-provider"            
#> [25] "hours-and-earnings"              "house-sales-and-prices"         
#> [27] "household-reference-person"      "income-type"                    
#> [29] "index-and-year-change"           "life-expectancy-cohort"         
#> [31] "life-expectancy-type"            "local-enterprise-partnership"   
#> [33] "local-health-board"              "measure-of-wellbeing"           
#> [35] "middle-layer-super-output-area"  "mmm"                            
#> [37] "mmm-mmm-yyyy"                    "mmm-yy"                         
#> [39] "nuts"                            "parliamentary-constituencies"   
#> [41] "pedestrians-and-vehicles"        "place-of-death"                 
#> [43] "property-type"                   "quarter"                        
#> [45] "quarterly-index-and-growth-rate" "quintile"                       
#> [47] "recorded-deaths"                 "registration-or-occurrence"     
#> [49] "seasonal-adjustment"             "sector"                         
#> [51] "sex"                             "ship-and-visit-type"            
#> [53] "shipping-port"                   "sic"                            
#> [55] "sic-unofficial"                  "single-year-of-age"             
#> [57] "sitc"                            "soc"                            
#> [59] "soc"                             "speak-welsh"                    
#> [61] "spend-category"                  "tax-benefit-type"               
#> [63] "trade-direction"                 "traffic-camera-area"            
#> [65] "travel-to-work-area"             "two-year-intervals"             
#> [67] "type-of-prices"                  "uk-business-unit"               
#> [69] "uk-only"                         "unit-of-measure"                
#> [71] "value-deflation"                 "week-number"                    
#> [73] "wellbeing-estimate"              "welsh-household-composition"    
#> [75] "working-pattern"                 "workplace-or-residence"         
#> [77] "years-quarters-months"           "yyyy"                           
#> [79] "yyyy-qq"                         "yyyy-to-yyyy-yy"                
ons_codelist(code_id = "quarter")
#> $links
#> $links$editions
#> $links$editions$href
#> [1] "https://api.beta.ons.gov.uk/v1/code-lists/quarter/editions"
#> 
#> 
#> $links$self
#> $links$self$href
#> [1] "https://api.beta.ons.gov.uk/v1/code-lists/quarter"
#> 
#> $links$self$id
#> [1] "quarter"
#> 
#> 
#> 

#editions
ons_codelist_editions(code_id = "quarter")
#>   edition label
#> 1 one-off      
#>                                                                 links.href
#> 1 https://api.beta.ons.gov.uk/v1/code-lists/quarter/editions/one-off/codes
#>                                                   links.href
#> 1 https://api.beta.ons.gov.uk/v1/code-lists/quarter/editions
#>                                                      links.self.href
#> 1 https://api.beta.ons.gov.uk/v1/code-lists/quarter/editions/one-off
#>   links.self.id
#> 1       one-off
ons_codelist_edition(code_id = "quarter", edition = "one-off")
#> $edition
#> [1] "one-off"
#> 
#> $label
#> [1] ""
#> 
#> $links
#> $links$codes
#> $links$codes$href
#> [1] "https://api.beta.ons.gov.uk/v1/code-lists/quarter/editions/one-off/codes"
#> 
#> 
#> $links$editions
#> $links$editions$href
#> [1] "https://api.beta.ons.gov.uk/v1/code-lists/quarter/editions"
#> 
#> 
#> $links$self
#> $links$self$href
#> [1] "https://api.beta.ons.gov.uk/v1/code-lists/quarter/editions/one-off"
#> 
#> $links$self$id
#> [1] "one-off"
#> 
#> 
#> 
# }