add_period | R Documentation |
Augments data
with an additional column holding the specified period in which the referendum took place. The new column is named after period
and its
values are always of type integer.
add_period(
data,
period = c("week", "month", "quarter", "year", "decade", "century")
)
data |
RDB referendum data as returned by |
period |
Type of period to add. One of
|
Note that the period
types "year"
, "decade"
and "century"
are unique timespans, while "week"
, "month"
and "quarter"
are recurring timespans (e.g. every year has a week 1).
A tibble.
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_turnout()
,
add_urls()
,
add_world_regions()
rdb::rfrnds(quiet = TRUE) |>
rdb::add_period() |>
dplyr::select(id, date, week)
rdb::rfrnds(quiet = TRUE) |>
rdb::add_period("year") |>
dplyr::select(id, date, year)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.