View source: R/elections_cepesp.R
elections_cepesp | R Documentation |
Retrieve electoral data from the cepesp API.
elections_cepesp(year, type, position, data_table = FALSE)
year |
The election year. Valid options are between 1998 to 2018 for positions such as President, Governor, Senator, Federal Deputy, State Deputy, and District Deputy. For Mayor or Councillor positions, valid options range from 2000 to 2016. |
type |
The type of data to retrieve. Valid options are "candidate" or "vote". |
position |
The position for which the data is requested. Valid options are President, Governor, Senator, Federal Deputy, State Deputy, District Deputy, Mayor, or Councillor. |
data_table |
If set to TRUE, the function will return the data as a data.table object. Default is FALSE. |
The function returns a tibble containing the requested elections data.
The function is a wrapper for the cepesp API. To learn more about the API, please visit cepespdata.io.
## Not run:
df <- elections_cepesp(2018, type = "candidate", position = "President")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.