Title: Download Data from the NISRA Data Portal
Version: 0.1.1
Description: Download data from the Northern Ireland Statistics and Research Agency (NISRA) data portal, accessed at https://data.nisra.gov.uk. NISRA is a government agency and the principal source of official statistics and social research on Northern Ireland.
License: MIT + file LICENSE
URL: https://github.com/MarkPaulin/nisrarr, https://markpaulin.github.io/nisrarr/
BugReports: https://github.com/MarkPaulin/nisrarr/issues
Encoding: UTF-8
RoxygenNote: 7.3.2
Depends: R (≥ 4.1.0)
Imports: cachem, dplyr, glue, httr2, jsonlite, lubridate, pillar, purrr, rjstat, rlang (≥ 1.1.0), stringr, tibble, vctrs
Suggests: ggplot2, knitr, prettyunits, rmarkdown, scales, testthat (≥ 3.0.0), vcr (≥ 0.6.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-06-06 18:31:28 UTC; mark
Author: Mark Paulin [aut, cre, cph]
Maintainer: Mark Paulin <paulin.mark@googlemail.com>
Repository: CRAN
Date/Publication: 2025-06-06 20:00:02 UTC

nisrarr: Download Data from the NISRA Data Portal

Description

Download data from the Northern Ireland Statistics and Research Agency (NISRA) data portal, accessed at https://data.nisra.gov.uk. NISRA is a government agency and the principal source of official statistics and social research on Northern Ireland.

Author(s)

Maintainer: Mark Paulin paulin.mark@googlemail.com [copyright holder]

See Also

Useful links:


Get metadata

Description

Retrieve metadata from a dataset, such as contact information, notes, and official statistics status.

Usage

get_metadata_field(x, field)

get_metadata(x)

Arguments

x

A nisra_df object created using nisra_read_dataset()

field

The metadata field to read. See details for a list of fields.

Details

Every dataset should have the following metadata fields:

Value

Metadata if the field is found, otherwise NULL

Examples

mye <- nisra_read_dataset("MYE01T09")
get_metadata(mye)
get_metadata_field(mye, "contact")

Create a nisra_df object

Description

Create a nisra_df, a data-frame with additional metadata. This uses vctrs::new_data_frame() to convert the ... argument to a data-frame.

Usage

nisra_df(..., meta = list())

Arguments

...

named arguments to convert to columns, or an existing data-frame, or a named list of columns

meta

List of metadata fields

Value

A nisra_df, a tbl_df with an additional "nisra_df" class attribute


Read NISRA data portal dataset

Description

Fetch a dataset from the NISRA data portal using the dataset code. You can search for a dataset using nisra_search().

Usage

nisra_read_dataset(dataset_code, flush_cache = FALSE)

Arguments

dataset_code

Dataset code

flush_cache

Ignore cached values

Value

A tibble with the requested dataset. If dataset_code is not found, an error will be thrown.

Examples

claimant_count_lgd <- nisra_read_dataset("CCMLGD")

Description

Search the NISRA data portal for a dataset. You can search dataset titles either for a keyword or with a regular expression, using a dataset code, or by variables that appear in dataset. You can also specify how recently the dataset must have been updated.

Usage

nisra_search(
  keyword = NULL,
  regex = NULL,
  dataset_code = NULL,
  variables = NULL,
  datefrom = NULL,
  flush_cache = FALSE
)

Arguments

keyword

Text to search for in dataset titles

regex

Regular expression for searching dataset titles

dataset_code

Dataset to find

variables

Variables to search for in datasets

datefrom

Date to search from. Search is limited to datasets updated in the last three months if not specified.

flush_cache

Ignore cached values

Value

A tibble of dataset information matching the search terms. This will include dataset codes, label, frequency, dimensions, and dimensions.

Examples

population_datasets <- nisra_search(keyword = "population")
age_datasets <- nisra_search(variables = "age")