Skip to contents

A function for retrieving single parliamentary case by id.

Usage

get_case(caseid = NA, good_manners = 0)

Arguments

caseid

Character string indicating the id of the case to request

good_manners

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

Value

A list with seven data frame elements:

  1. $root (main data on the case)

    response_dateDate of data retrieval
    versionData version from the API
    document_groupCase document group type
    finalizedWhether the case finalized
    referenceRelevant publication references
    idCase id
    req_textRecommendation (proposal) text
    committee_idId of committee handling the case
    title_shortCase short title
    decision_shortCase decision_short
    parenthesis_textCase parenthesis text
    case_numberCase number
    session_idSession id
    proceedings_idType of proceeding id
    proceedings_nameType of proceeding name
    statusStatus for case
    titleCase title (long)
    typeCase type
    decision_textDecision text
  2. $topic (the topics related to the case)

    is_main_topicIs this (row) the main topic?
    main_topic_idId for main topic
    idTopic id
    navnTopic name
  3. $publication_references (references for publications on the case)

    export_idId for export of publication (used in ?get_publication)
    link_textPublication title
    link_urlURL to publication
    typePublication type
    subtypePublication subtype (chamber)
  4. $proposers (MPs behind case proposal, when relevant)

    mp_idMPs id
    party_idParty id of MPs
    sub_mpWhether MPs are substitutes
  5. $proceeding_steps (case proceeding steps)

    step_nameName of steps
    step_numberStep order for case
    outdatedWhether the step type is outdated
  6. $spokespersons (all MPs that are spokespersons for the case)

    mp_idMPs id
    party_idParty id of MPs
    sub_mpWhether MPs are substitutes
  7. $keywords (all keywords associated with the case)

    keywordKeywords for the case

Examples


if (FALSE) { # \dontrun{

# Get one case
case <- get_case("30233")
case

# Get multiple cases
cases <- lapply(c("30233", "30362", "30234", "30236"), get_case, good_manners = 2)
cases_root <- lapply(cases, function(x) x$root)
cases_root <- do.call(rbind, cases_root)
cases_root

cases_keywords <- lapply(1:nrow(cases_root), function(x){
  tmp <- cases[[x]]$keywords
  tmp$case_id <- cases_root$id[x]
  return(tmp)
})
cases_keywords <- do.call(rbind, cases_keywords)
cases_keywords

} # }