get_traffic {legislatoR}R Documentation

Fetch Wikipedia 'Traffic' table

Description

Fetches daily user traffic on legislators' Wikipedia biographies for the specified legislature. Requires a working Internet connection.

Usage

get_traffic(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:

Value

A data frame with columns as specified above.

Source

Wikimedia API, https://wikimedia.org/api/rest_v1/
http://petermeissner.de:8880/

Examples

# Get entire 'Traffic' table for the Scottish Parliament
sco_traffic <- get_traffic(legislature = "sco")
tibble::glimpse(sco_traffic)

# Add Wikidataid to 'Traffic' table for the Scottish Parliament
sco_traffic_subset <- dplyr::inner_join(x = dplyr::select(get_core(legislature = "sco"),
                                                          pageid, wikidataid),
                                        y = sco_traffic,
                                        by = "pageid")
tibble::glimpse(sco_traffic_subset)


[Package legislatoR version 1.1.0 Index]