constid: Get constituency identifier

Description Usage Arguments Note See Also Examples

Description

This function converts between four different sets of constituency identifiers.

Usage

1
constid(sourcevar, origin, destination, warn = TRUE)

Arguments

sourcevar

Vector which contains the codes to be converted

origin

Coding scheme to convert from

destination

Coding scheme to convert to

warn

Flags IDs which return zero or multiple matches

Note

Supports the following coding schemes: Press Association reference number ('pa_id'), Hansard ID ('hansard_id'), ParlParseID ('parlparse_id'), Office of National Statistics ID ('ons_id'). Will try and handle constituency names ('name').

See Also

election.pressassociation.com/Constituencies/general.php, https://en.wikipedia.org/wiki/ONS_coding_system, https://github.com/mysociety/parlparse

Examples

1
2
codes.of.origin <- pano::pano_data$pa_id # Vector of values to be converted
constid(codes.of.origin, "pa_id", "ons_id")

chrishanretty/pano documentation built on May 13, 2019, 6:54 p.m.