Learn R Programming

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

electionsBR

electionsBR contains a set of functions that automatically downloads and aggregates election data from Brazil (1996-2014), directly from the Brazilian Superior Electoral Court website (TSE). Among others, there are data available on local and federal elections for all positions (city councillor, mayor, state deputy, federal deputy, governor, and president) disaggregated by state of the Federation, city, zone, and polling stations.

Installation

For the time being, electionsBR is only available at GitHub. You can install this pre-release version via:

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

How does it work?

electionsBR provides ten main functions to dowload and clean Brazilian electoral data:

  • candidate_fed()
  • candidate_local()
  • details_mun_zone_fed()
  • details_mun_zone_local()
  • legend_fed()
  • legend_local()
  • party_mun_zone_fed()
  • party_mun_zone_local()
  • vote_mun_zone_fed()
  • vote_mun_zone_local()

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

df <- candidate_fed(year = 2002)

Authors

Denisson Silva, Fernando Meireles, and Beatriz Costa.

License

GPL (>= 2)

Copy Link

Version

Install

install.packages('electionsBR')

Monthly Downloads

800

Version

0.1.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Denisson Silva

Last Published

August 18th, 2016

Functions in electionsBR (0.1.1)

candidate_fed

Download data on the candidates' backgrounds in federal elections
party_mun_zone_fed

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

Reads and rbinds multiple data.frames in the same directory
details_mun_zone_fed

Download data on the verification of federal elections in Brazil
details_mun_zone_local

Download data on the verification of local elections in Brazil
party_mun_zone_local

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

Download data on local election coalitions in Brazil
legend_fed

Download data on federal election coalitions in Brazil
Moda

Calculates the mode of a distribution
candidate_local

Download data on the candidates' background in local elections
vote_mun_zone_fed

Download data on the polls by candidate from federal elections in Brazil
test_fed_year

Tests federal election year inputs
vote_mun_zone_local

Download data on the polls by candidate from local elections in Brazil
test_local_year

Tests federal election year inputs