month_contains_election: Finds the election relating to a month (where an election...

View source: R/define_sets.R

month_contains_electionR Documentation

Finds the election relating to a month (where an election took place on any day that month).

Description

Finds the election relating to a month (where an election took place on any day that month).

Usage

month_contains_election(
  the_date,
  election_start_col = "monthsearch_start",
  election_end_col = "monthsearch_end",
  election_data = durhamevp::election_dates,
  return_col = "election_name"
)

Arguments

the_date

the month to classifiy as yyyy-mm-dd where dd must be 01.

election_start_col

the column in the election data frame which identifies when the election starts.

election_end_col

the column in the election data frame which identifies when the election ends.

election_data

the data frame containing the election data.

return_col

the column in the data frame containing the name of the election (to be returned by the function).


gidonc/durhamevp documentation built on April 8, 2022, 10:31 a.m.