Skip to contents

Given a year and/or date by the user, this function returns a data frame with information related to the date of the elections.

Usage

detect_years(type_elec = "congress", year = NULL, date = NULL)

Arguments

type_elec

Type of the election. Defaults to "congress".

year

A vector or single value representing the years of the elections to be considered. Please, check in dates_elections_spain the elections of the specified type are available for the provided year.

date

A vector or single value representing the dates of the elections to be considered. If date was provided, it should be in format %Y-%m-%d (e.g., '2000-01-01'). Defaults to NULL. If no date was provided, year should be provided as numerical variable. Please, check in dates_elections_spain the elections of the specified type are available.

Details

This function is used as a helper function to select the dates asked for the users in the import and summary functions.

Author

David Pereiro-Pol.