get_profession {legislatoR} | R Documentation |
Fetch 'Professions' table
Description
Fetches occupational data of legislators for the specified legislature. Requires a working Internet connection.
Usage
get_profession(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 in wide format with columns (varies by legislature):
wikidataid: Wikidata ID identifying a legislator's Wikidata entry (of class ‘character’).
occupation_1: occupation a legislator practiced or was trained in (of class ‘logical’).
occupation_2: ... (of class ‘logical’).
...
Value
A data frame with columns as specified above.
Source
Wikidata API, https://www.wikidata.org/wiki/Wikidata:Main_Page
Examples
# Get entire 'Professions' table for the United States House
usa_offices <- get_office(legislature = "usa_house")
tibble::glimpse(usa_offices)
# Get 'Professions' table for female members of the United States House
usa_offices_subset <- dplyr::semi_join(x = usa_offices,
y = dplyr::filter(get_core(legislature = "usa_house"),
sex == "female"),
by = "wikidataid")
tibble::glimpse(usa_offices_subset)
[Package legislatoR version 1.1.0 Index]