get_core {legislatoR} | R Documentation |
Fetch 'Core' table
Description
Fetches sociodemographic data of legislators for the specified legislature. Requires a working Internet connection.
Usage
get_core(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):
country: ISO 3166-1 alpha-3 three-letter country code (of class ‘character’).
pageid: Wikipedia page ID identifying a legislator's Wikipedia biography (of class ‘integer’ or ‘character’).
wikidataid: Wikidata ID identifying a legislator's Wikidata entry (of class ‘character’).
wikititle: A legislator's undirected Wikipedia title (of class ‘character’).
name: A legislator's full name (of class ‘character’).
sex: A legislator's sex (of class ‘character’).
ethnicity: A legislator's ethnicity (of class ‘character’).
religion: A legislator's religious denomination (of class ‘character’).
birth: A legislator's date of birth (of class ‘POSIXct’).
death: A legislator's date of death (of class ‘POSIXct’).
birthplace: Comma separated latitude and longitude of a legislator's place of birth (of class ‘character’).
deathplace: Comma separated latitude and longitude of a legislator's place of death (of class ‘character’).
Value
A data frame with columns as specified above.
Source
Wikipedia, https://www.wikipedia.org/
Wikipedia API, https://en.wikipedia.org/w/api.php
Wikidata API, https://www.wikidata.org/wiki/Wikidata:Main_Page
Wikimedia Commons, https://commons.wikimedia.org/wiki/Main_Page
Face++ Cognitive Services API, https://www.faceplusplus.com/
Germany Bundestag Open Data, https://www.bundestag.de/services/opendata
Examples
# Get entire 'Core' table for the German Bundestag
deu_core <- get_core(legislature = "deu")
tibble::glimpse(deu_core)
# Get 'Core' table for 16th session of the German Bundestag
deu_core_subset <- dplyr::semi_join(x = deu_core,
y = dplyr::filter(get_political(legislature = "deu"),
session == 16),
by = "pageid")
tibble::glimpse(deu_core_subset)