Skip to contents

A function for retrieving vote results from a specific vote on MP level. Vote data are only available from the 2011-2012 session. Needs some preprocessing for use with rollcall packages, such as ideal.

Usage

get_result_vote(voteid = NA, good_manners = 0)

Arguments

voteid

Character string indicating the id of the vote to request all votes from

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
vote_idId of vote
mp_idMP id
party_idParty id
voteVote: for, mot (against), ikke_tilstede (absent)
permanent_sub_forId of the MP originally holding the seat, if the substitute is permanent
sub_forId of the MP originally holding the seat

Examples


if (FALSE) {

v <- get_result_vote(12345)
table(v$vote)

p <- get_proposal_votes(12345)

stringr::str_replace_all(p$proposal_vote$proposal_text, 
                         "\\<(.*)\\>|\\r\\n", "")  |> 
  stringr::str_trim()
}