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_date | Date of data retrieval |
version | Data version from the API |
death | MP date of death, if applicable |
last_name | MP last name |
birth | MP date of birth |
first_name | MP first name |
id | MP id |
gender | MP 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)
} # }