| Title: | 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. |
| Authors: | Mark Paulin [aut, cre, cph] |
| Maintainer: | Mark Paulin <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1.9000 |
| Built: | 2026-05-16 06:34:44 UTC |
| Source: | https://github.com/MarkPaulin/nisrarr |
Retrieve metadata from a dataset, such as contact information, notes, and official statistics status.
get_metadata_field(x, field) get_metadata(x)get_metadata_field(x, field) get_metadata(x)
x |
A nisra_df object created using |
field |
The metadata field to read. See details for a list of fields. |
Every dataset should have the following metadata fields:
contact - contact name, email and phone
copyright - copyright information
experimental - a flag for experimental statistics
note - any notes describing the data
official - a flag for official statistics
subject - a code and label for the subject
updated - date
Metadata if the field is found, otherwise NULL
mye <- nisra_read_dataset("MYE01T09") get_metadata(mye) get_metadata_field(mye, "contact")mye <- nisra_read_dataset("MYE01T09") get_metadata(mye) get_metadata_field(mye, "contact")
Create a nisra_df, a data-frame with additional metadata. This uses
vctrs::new_data_frame() to convert the ... argument to a data-frame.
nisra_df(..., meta = list())nisra_df(..., meta = list())
... |
named arguments to convert to columns, or an existing data-frame, or a named list of columns |
meta |
List of metadata fields |
A nisra_df, a tbl_df with an additional
"nisra_df" class attribute
Attach boundaries to a dataset
nisra_get_boundaries(x)nisra_get_boundaries(x)
x |
A |
An sf object with all the columns of x and an additional geometry
column.
Fetch a dataset from the NISRA data portal using the dataset code. You
can search for a dataset using nisra_search().
nisra_read_dataset(dataset_code, flush_cache = FALSE)nisra_read_dataset(dataset_code, flush_cache = FALSE)
dataset_code |
Dataset code |
flush_cache |
Ignore cached values |
A tibble with the requested dataset. If dataset_code
is not found, an error will be thrown.
claimant_count_lgd <- nisra_read_dataset("CCMLGD")claimant_count_lgd <- nisra_read_dataset("CCMLGD")
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.
nisra_search( keyword = NULL, regex = NULL, dataset_code = NULL, variables = NULL, datefrom = NULL, flush_cache = FALSE )nisra_search( keyword = NULL, regex = NULL, dataset_code = NULL, variables = NULL, datefrom = NULL, flush_cache = FALSE )
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 |
A tibble of dataset information matching the search terms. This will include dataset codes, label, frequency, dimensions, and dimensions.
population_datasets <- nisra_search(keyword = "population") age_datasets <- nisra_search(variables = "age")population_datasets <- nisra_search(keyword = "population") age_datasets <- nisra_search(variables = "age")