get_social: Fetch 'Social' table

View source: R/get_social.R

get_socialR Documentation

Fetch 'Social' table

Description

Fetches social media handles and website URLs of legislators for the specified legislature. Requires a working Internet connection.

Usage

get_social(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’).

  • twitter: Twitter handle (of class ‘character’).

  • facebook: Facebook handle (of class ‘character’).

  • youtube: Youtube ID (of class ‘character’).

  • googlep: Google Plus ID (of class ‘character’).

  • instagram: Instagram handle (of class ‘character’).

  • linkedin: LinkedIn ID (of class ‘character’).

  • website: Personal website URL (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 'Social' table forthe UK House of Commons
gbr_social <- get_social(legislature = "gbr")
tibble::glimpse(gbr_social)

# Get 'Social' table for members of the UK House of Commons with available TheyWorkForYou ID
gbr_social_subset <- dplyr::semi_join(x = gbr_social,
                                      y = dplyr::filter(get_ids(legislature = "gbr"),
                                                        !is.na(theyworkforyou)),
                                      by = "wikidataid")
tibble::glimpse(gbr_social_subset)


saschagobel/legislatoR documentation built on Jan. 30, 2024, 7:52 p.m.