R/metadata.R
Retrieve all concept code options of all Nomis datasets, concept
code options for a given dataset, or the all the options for a given
concept variable from a particular dataset. Specifying concept
will
return all the options for a given variable in a particular dataset.
If looking for a more detailed overview of all available
metadata for a given dataset, see nomis_overview
.
nomis_get_metadata(id, concept = NULL, type = NULL, search = NULL, additional_queries = NULL)
id | The ID of the particular dataset. Returns no data if not specified. |
---|---|
concept | A string with the variable concept to return options for. If
left empty, returns all the variables for the dataset specified by |
type | A string with options for a particular code value, to return
types of variables available for a given code. Defaults to |
search | A string or character vector of strings to search for in the
metadata. Defaults to |
additional_queries | Any other additional queries to pass to the API.
See https://www.nomisweb.co.uk/api/v01/help for instructions on
query structure. Defaults to |
A tibble with options.
#> Observations: 5 #> Variables: 3 #> $ codelist <chr> "CL_1_1_GEOGRAPHY", "CL_1_1_SEX", "CL_1_1_ITEM... #> $ conceptref <chr> "GEOGRAPHY", "SEX", "ITEM", "MEASURES", "FREQ" #> $ isfrequencydimension <chr> "false", "false", "false", "false", "true"#> Observations: 7 #> Variables: 2 #> $ description <chr> "United Kingdom", "Great Britain", "England", "Wales", ... #> $ value <int> 2092957697, 2092957698, 2092957699, 2092957700, 2092957...# returns all types of geography c <- nomis_get_metadata('NM_1_1', 'geography', 'TYPE') tibble::glimpse(c)#> Observations: 96 #> Variables: 2 #> $ description <chr> "1991 frozen wards", "parliamentary constituencies 1983... #> $ value <chr> "TYPE1", "TYPE8", "TYPE18", "TYPE27", "TYPE33", "TYPE45...# returns geography types available within Wigan d <- nomis_get_metadata('NM_1_1', 'geography', '1879048226') tibble::glimpse(d)#> Observations: 3 #> Variables: 2 #> $ description <chr> "Wigan", "local authorities: district / unitary (prior ... #> $ value <chr> "1879048226", "1879048226TYPE464", "1879048226TYPE486"e <- nomis_get_metadata('NM_1_1', 'item', additional_queries = "?geography=1879048226&sex=5") tibble::glimpse(e)#> Observations: 5 #> Variables: 2 #> $ description <chr> "Total claimants", "Students on vacation", "Temporarily... #> $ value <int> 1, 2, 3, 4, 9#> Observations: 1 #> Variables: 2 #> $ description <chr> "Married females" #> $ value <int> 9