get_ids: Fetch 'IDs' table

View source: R/get_ids.R

get_idsR Documentation

Fetch 'IDs' table

Description

Fetches a range of IDs of legislators for the specified legislature. Requires a working Internet connection.

Usage

get_ids(legislature)

Arguments

legislature

A character string specifying the three-letter country code of the legislature for which data shall be fetched. Currently one of ‘aut’, ‘can’, ‘cze’, ‘esp’, ‘fra’, ‘deu’, ‘irl’, ‘sco’, ‘gbr’, ‘usa_house’, or ‘usa_senate’.

Format

Data frame with columns (varies by legislature):

  • wikidataid: Wikidata ID identifying a legislator's Wikidata entry (of class ‘character’).

  • parlid: Parliamentary website or website ID (of class ‘character’).

  • btvote: ID for BTVote data on all roll call votes taken in the German Bundestag from 1949 to 2013 and for Reelection Prospects data. The respective ID in BTVote and Reelection Prospects data is 'mp_id' (of class ‘character’).

  • parlspeech: ID for ParlSpeech datasets containing full-text vectors of plenary speeches. The respective ID in ParlSpeech data is 'speaker' (of class ‘character’).

  • dpsi: ID for Database of Parliamentary Speeches in Ireland. The respective ID in the Database of Parliamentary Speeches in Ireland is 'memberID' (of class ‘character’).

  • eggersspirling: ID for Eggers and Spirling British political development database. The respective ID in Eggers and Spirling data is 'member.id' (of class ‘character’).

  • bioguide: ID for the Voteview congressional roll-call votes database. The respective ID in Voteview data is 'bioguide_id' (of class ‘character’).

  • icpsr: ID for Congressional Bills Project database. The respective ID in Congressional Bills Project data is 'icpsr' (of class ‘character’).

  • sycomore: Sycomore database of French MPs (of class ‘character’).

  • libcon: Library of Congress ID (of class ‘character’).

  • gnd: German National Library ID (of class ‘character’).

  • bnf: French National Library ID (of class ‘character’).

  • freebase: Freebase ID (of class ‘character’).

  • munzinger: Munzinger archive ID (of class ‘character’).

  • nndb: Notable Names Database ID (of class ‘character’).

  • imdb: Internet Movie Database ID (of class ‘character’).

  • brittanica: Encyclopedia Brittanica ID (of class ‘character’).

  • quora: Quora ID (of class ‘character’).

  • votesmart: Project Votesmart ID (of class ‘character’).

  • fec: Federal Election Commission ID (of class ‘character’).

  • ballotpedia: Ballotpedia ID (of class ‘character’).

  • opensecrets: Opensecrets ID (of class ‘character’).

  • genealogists: Genealogists ID (of class ‘character’).

  • politfacts: Politfacts ID (of class ‘character’).

  • nkcr: Czech National Library ID (of class ‘character’).

  • parlbio: parliament.uk biography ID (of class ‘character’).

  • parlthesaurus: UK Parliament thesaurus ID (of class ‘character’).

  • national: UK National Archives ID (of class ‘character’).

  • hansard: Hansard (1803-2005) ID (of class ‘character’).

  • publicwhip: PublicWhip ID (of class ‘character’).

  • theyworkforyou: TheyWorkForYou ID (of class ‘character’).

Value

A data frame with columns as specified above.

Source

Wikidata API, https://www.wikidata.org/wiki/Wikidata:Main_Page

Examples

# Get entire 'IDs' table for the for the United States Senate
usa_ids <- get_ids(legislature = "usa_senate")
tibble::glimpse(usa_ids)

# Get ICPSR IDs and add 'Offices' table for the United States House
usa_ids_subset <- dplyr::inner_join(x = dplyr::filter(usa_ids,
                                                      !is.na(icpsr)),
                                    y = get_office(legislature = "usa_senate"),
                                    by = "wikidataid")
tibble::glimpse(usa_ids_subset)


legislatoR documentation built on April 3, 2023, 5:22 p.m.