legislative_state_vote() downloads, cleans, and transforms data on legislative elections results by state The electoral results are, by default, reported as proportions. The user can choose between Senate and Chamber of Deputies electoral results.

legislative_state_vote(year, house = c("chamber", "senate"), prop = TRUE,
  ascii = FALSE, encoding = "Latin-1")



Election year (integer). For this function, only the years 1998, 2002, 2006, 2010, and 2014 are available.


Report results from which legislative house? Options are senate and chamber.


Shoud the votes be reported as proportions? (Defaults to TRUE).


(logical). Should the text be transformed from Latin-1 to ASCII format?


Data original encoding (defaults to 'Latin-1'). This can be changed to avoid errors when ascii = TRUE.


legislative_state_vote() returns a tbl, data.frame with the following variables:.

  • ANO_ELEICAO: Election year.

  • SIGLA_UF: Unit of the Federation's acronym in which occurred the election.

  • SIGLA_PARTIDO: Party acronym.

  • NOME_PARTIDO: Party name.

  • NUMERO_PARTIDO: Party number.

  • NOME_COLIGACAO: Coalition shortname.

  • COMPOSICAO_LEGENDA: Party's shortname composition.

  • TOTAL_VOTOS: Party votos (or proportions) votes by state.

See also

legislative_mun_vote for legislative elections results by municipality; president_mun_vote for presidential elections results by municipality; and president_state_vote for presidential elections results by state.


not_run({ df <- legislative_state_vote(2002) })