Nothing
knitr::opts_chunk$set(collapse = TRUE, comment = "#>") # Use temp directory during vignette build to avoid CRAN NOTE Sys.setenv(NOMISDATA_CACHE_DIR = file.path(tempdir(), "nomisdata"))
The nomisdata package provides easy access to UK official statistics from the Nomis database, including:
# From CRAN install.packages("nomisdata") # Development version # install.packages("remotes") remotes::install_github("yourname/nomisdata")
library(nomisdata) # Search by name employment <- search_datasets(name = "*employment*") head(employment) # Search by keywords census <- search_datasets(keywords = "census")
# Get dataset information describe_dataset("NM_1_1") # Get available concepts/dimensions concepts <- get_codes("NM_1_1") print(concepts)
# Get geography codes geographies <- get_codes("NM_1_1", "geography") head(geographies) # Search for specific geography london <- lookup_geography("London") print(london) # Get measure codes measures <- get_codes("NM_1_1", "measures") print(measures)
# Latest JSA data by country jsa_data <- fetch_nomis( id = "NM_1_1", time = "latest", geography = "TYPE499", # Countries measures = 20100, # Claimants sex = 7 # Total ) head(jsa_data)
For offline work, use the included sample dataset:
library(nomisdata) data(jsa_sample) head(jsa_sample)
For higher rate limits (100,000 vs 25,000 rows):
# Register at: https://www.nomisweb.co.uk/myaccount/userjoin.asp # Set for current session set_api_key("your-api-key") # Or save to .Renviron for persistence set_api_key("your-api-key", persist = TRUE)
vignette("geography") for working with geographiesvignette("time-series") for time series queriesvignette("caching") for caching strategiesAny scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.