Nomis uses its own internal coding for query concepts. nomis_codelist
returns the codes for a given concept in a tibble
, given a dataset
ID and a concept name.
Note that some codelists, particularly geography, can be very large.
Arguments
- id
A string with the ID of the particular dataset. Must be specified.
- concept
A string with the variable concept to return options for. If left empty, returns all the variables for the dataset specified by
id
. Codes are not case sensitive and must be specified.- search
Search for codes that contain a given string. The wildcard character
*
can be added to the beginning and/or end of each search string. Search strings are not case sensitive. Defaults toNULL
. Note that the search function is not very powerful for some datasets.
Examples
# \donttest{
x <- nomis_codelist("NM_1_1", "item")
#> Error in curl::curl_fetch_memory(url, handle = handle): Timeout was reached: [www.nomisweb.co.uk] Resolving timed out after 10000 milliseconds
# Searching for codes ending with "london"
y <- nomis_codelist("NM_1_1", "geography", search = "*london")
#> Error in curl::curl_fetch_memory(url, handle = handle): Timeout was reached: [www.nomisweb.co.uk] Resolving timed out after 10000 milliseconds
z <- nomis_codelist("NM_161_1", "cause_of_death")
#> Error in curl::curl_fetch_memory(url, handle = handle): Timeout was reached: [www.nomisweb.co.uk] Resolving timed out after 10000 milliseconds
# }