Getting Started with nomisdata"

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"))

Introduction

The nomisdata package provides easy access to UK official statistics from the Nomis database, including:

Installation

# From CRAN
install.packages("nomisdata")

# Development version
# install.packages("remotes")
remotes::install_github("yourname/nomisdata")

Basic Workflow

1. Search for Datasets

library(nomisdata)

# Search by name
employment <- search_datasets(name = "*employment*")
head(employment)

# Search by keywords
census <- search_datasets(keywords = "census")

2. Explore Dataset Structure

# Get dataset information
describe_dataset("NM_1_1")

# Get available concepts/dimensions
concepts <- get_codes("NM_1_1")
print(concepts)

3. Get Code Options

# 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)

4. Download Data

# 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)

Using Example Data

For offline work, use the included sample dataset:

library(nomisdata)
data(jsa_sample)
head(jsa_sample)

API Key Setup

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)

Next Steps



Try the nomisdata package in your browser

Any scripts or data that you put into this service are public.

nomisdata documentation built on Feb. 10, 2026, 5:10 p.m.