Skip to contents

A function for retrieving all votes from a specific vote proposal. Vote data are only available from the 2011-2012 session

Usage

get_proposal_votes(voteid = NA, good_manners = 0)

Arguments

voteid

Character string, or a vector of strings, indicating the id of the vote to retrieve proposals from

good_manners

Numeric. Seconds delay between calls when making multiple calls to the same function. Note that the Stortinget API is limited to 100 calls per minute (see https://data.stortinget.no/nyhetsoversikt/begrensning-pa-api-kall/).

Value

A list with two elements:

  1. $proposal_vote (main data on the proposals, one row per proposal)

    response_dateDate of data retrieval
    versionData version from the API
    vote_idId of the vote
    proposal_designationDesignation of the proposal
    proposal_designation_shortShort designation of the proposal
    proposal_idId of the proposal
    proposal_delivered_by_mpId of the MP delivering the proposal
    proposal_on_behalf_of_textText on whose behalf the proposal is
    proposal_sortingnumberSorting number of the proposal
    proposal_textText of the proposal
    proposal_typeType of proposal
  2. $proposal_by_parties (a list named by proposal_id, each element a character vector of the ids of the parties behind the proposal)

Examples


if (FALSE) { # \dontrun{

prop <- get_proposal_votes(7523)
prop

for(i in 1:length(prop$proposal_by_parties)){
    prop$proposal_vote$parties[i] <- paste0(prop$proposal_by_parties[[i]], 
                                            collapse = ", ")

}

} # }