Learn R Programming

⚠️There's a newer version (0.4.0) of this package.Take me there.

electionsBR

electionsBR offers a set of functions to easily pull and clean Brazilian electoral data from the Brazilian Superior Electoral Court (TSE) website. Among others, the package retrieves data on local and federal elections for all positions (city councilor, mayor, state deputy, federal deputy, governor, and president) aggregated by state, city, and electoral zones.

Installation

electionsBR is on CRAN and can be installed with:

install.packages("electionsBR")

electionsBR is also available on GitHub. You can install pre-release versions via:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("silvadenisson/electionsBR")

How does it work?

To download data from a given election, only the year argument must be passed to the function call:

library(electionsBR)
df <- candidate_fed(year = 2002)

You may also export Brazilian electoral data to Stata and SPSS by setting the export optional argument to TRUE:

df <- candidate_fed(2002, export = TRUE)

As well as subset your results by state using the uf argument:

df <- vote_mun_zone_fed(2002, uf = "RS")

For more information on how the package works and for a complete list of functions, see the vignette.

Citation

To cite electionsBR in publications, please use:

citation("electionsBR")

Authors

Denisson Silva, Fernando Meireles, and Beatriz Costa.

Copy Link

Version

Install

install.packages('electionsBR')

Monthly Downloads

765

Version

0.3.2

License

GPL (>= 2)

Maintainer

Denisson Silva

Last Published

January 30th, 2021

Functions in electionsBR (0.3.2)

candidate_fed

Download data on the candidates' backgrounds in federal elections
details_mun_zone_fed

Download data on the verification of federal elections in Brazil
parties_br

Returns a vector with the abbreviations of all Brazilian parties
party_mun_zone_fed

Download data on the polls by parties from federal elections in Brazil
details_mun_zone_local

Download data on the verification of local elections in Brazil
candidate_local

Download data on the candidates' background in local elections
electionsBR-package

R functions to download and clean Brazilian electoral Data
legend_fed

Download data on federal election coalitions in Brazil
elections_rda

Download data on the candidates' background in local elections
personal_finances_local

Download data on local candidates' personal financial disclosures
party_mun_zone_local

Download data on the polls by parties from local elections in Brazil
seats_local

Download data on the number of seats under dispute in local elections
seats_fed

Download data on the number of seats under dispute in federal elections
uf_br

Returns a vector with the abbreviations of all Brazilian states
vote_section_local

Download data on candidate electoral results in local elections in Brazil by electoral section
vote_mun_zone_fed

Download data on candidate electoral results in federal elections in Brazil
voter_affiliation

Download data on voters' affiliation to political parties
personal_finances_fed

Download data on federal candidates' personal financial disclosures
voter_profile_by_section

Download data on the voters' profile by vote section
voter_profile

Download data on the voters' profile
legend_local

Download data on local election coalitions in Brazil
vote_mun_zone_local

Download data on candidate electoral results in local elections in Brazil
vote_section_fed

Download data on candidate electoral results in federal elections in Brazil by electoral section
%>%

Pipe operator