Skip to contents

A function for retrieving information on Norwegian MPs from the parliament API

Usage

get_mp(mpid = NA, good_manners = 0)

Arguments

mpid

Character string indicating the id of the MP to retrieve.

good_manners

Integer. Seconds delay between calls when making multiple calls to the same function

Value

A data.frame with the following variables:

response_dateDate of data retrieval
versionData version from the API
deathMP date of death, if applicable
last_nameMP last name
birthMP date of birth
first_nameMP first name
idMP id
genderMP gender

Examples

if (FALSE) { # \dontrun{
# Request one MP by id
get_mp("AAMH")

# Request several MPs by id
ids <- c("AAMH", "AMSK", "MAAA")

mps <- lapply(ids, get_mp, good_manners = 2)

mps <- do.call(rbind, mps)
} # }