get_ids {legislatoR}R 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):

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)


[Package legislatoR version 1.1.0 Index]