Skip to contents

A function for retrieving Norwegian MPs for a given parliamentary period from the parliament API

Usage

get_parlperiod_mps(periodid = NA, substitute = FALSE, good_manners = 0)

Arguments

periodid

Character string indicating the id of the parliamentary period to retrieve.

substitute

Logical. Whether or not to include substitute MPs.

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
deathDate of death
lastnameMP last name
birthDate of birth
firstnameMP first name
mp_idMP id
genderMP gender
county_idId of county MP represented
party_idId of party MP represented
substitute_mpLogical for whether MP is a substitute
period_idId of period represented in

Examples


if (FALSE) { # \dontrun{

# Request one MP by id
get_parlperiod_mps("2005-2009")

# Request MPs from several periods by id
ids <- c("1961-65", "1997-01", "2009-2013")
mps <- lapply(ids, get_parlperiod_mps, good_manners = 2)
mps <- do.call(rbind, mps)

} # }