add_urls: Add various URLs to referendum data

add_urlsR Documentation

Add various URLs to referendum data

Description

Augments data with additional columns holding URLs of the specified types. The new columns will be named after types, prefixed with url_, so types = "sudd" will add the column url_sudd etc.

Usage

add_urls(data, types = c("sudd", "swissvotes"))

Arguments

data

RDB referendum data as returned by rfrnds(). A data frame that at minimum contains the column id_sudd for types = "sudd" and the columns country_code, level and id_official for types = "swissvotes".

types

Type(s) of URLs to add. One or more of "sudd" or "swissvotes".

Value

A tibble.

See Also

Other referendum data augmentation functions: add_country_code_continual(), add_country_code_long(), add_country_name(), add_country_name_long(), add_former_country_flag(), add_period(), add_turnout(), add_world_regions()

Examples

rdb::rfrnds(quiet = TRUE) |>
  dplyr::filter(country_code == "CH" & level == "national") |>
  rdb::add_urls() |>
  dplyr::select(id,
                country_code,
                level,
                starts_with("id_"),
                starts_with("url_"))

zdaarau/c2d documentation built on Dec. 18, 2024, 1:24 p.m.