vote_mun_zone_local: Download data on candidate electoral results in local...

View source: R/vote_mun_zone_local.R

vote_mun_zone_localR Documentation

Download data on candidate electoral results in local elections in Brazil

Description

vote_mun_zone_local() downloads and aggregates data on the verification from local elections in Brazil, disaggregated by electoral zone. The function returns a data.frame where each observation corresponds to a city/zone.

Usage

vote_mun_zone_local(
  year,
  uf = "all",
  ascii = FALSE,
  encoding = "latin1",
  export = FALSE,
  temp = TRUE
)

Arguments

year

Election year. For this function, only the years 1996, 2000, 2004, 2008, 2012, 2016 and 2020 are available.

uf

Federation Unit acronym (character vector).

ascii

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

encoding

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

export

(logical). Should the downloaded data be saved in .dta and .sav in the current directory?

temp

(logical). If TRUE, keep the temporary compressed file for future use (recommended)

Details

If export is set to TRUE, the downloaded data is saved as .dta and .sav files in the current directory.

Value

vote_mun_zone_local() returns a data.frame with the following variables:

  • DATA_GERACAO: Generation date of the file (when the data was collected).

  • HORA_GERACAO: Generation time of the file (when the data was collected), Brasilia Time.

  • ANO_ELEICAO: Election year.

  • NUM_TURNO: Round number.

  • DESCRICAO_ELEICAO: Description of the election.

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

  • SIGLA_UE: Units of the Federation's acronym (In case of major election is the FU's acronym in which the candidate runs for (text) and in case of municipal election is the municipal's Supreme Electoral Court code (number)). Assume the special values BR, ZZ and VT to designate, respectively, Brazil, Overseas and Absentee Ballot.

  • CODIGO_MUNICIPIO: Supreme Electoral code from the city where occurred the election.

  • NOME_MUNICIPIO: Name of the city where occurred the election.

  • NUMERO_ZONA: Zone number.

  • CODIGO_CARGO: Code of the position that the candidate runs for.

  • NUMERO_CANDIDATO: Candidate's number in the ballot box.

  • SQ_CANDIDATO: Candidate's sequence number generated internally by the electoral

  • NOME_CANDIDATO: Candidate's complete name.

  • NOME_URNA_CANDIDATO: Candidate's ballot box name.

  • DESCRICAO_CARGO: Description of the position that the candidate runs for.

  • COD_SIT_CAND_TOT: Candidate's totalization status code in that election round.

  • NUMERO_PARTIDO: Party number.

  • SIGLA_PARTIDO: Party's acronym.

  • NOME_PARTIDO: Party name.

  • SEQUENCIAL_LEGENDA: Coalition's sequential number, generated internally by the electoral justice.

  • NOME_COLIGACAO: COalition name.

  • COMPOSICAO_LEGENDA: Coalition's composition.

  • TOTAL_VOTOS: Total of votes.

  • TRANSITO: Electoral result outside the candidates' district? (N for no).

Note

For the elections prior to 2000, some information can be incomplete.

See Also

vote_mun_zone_fed for federal elections in Brazil.

Examples

## Not run: 
df <- vote_mun_zone_local(2000)

## End(Not run)

electionsBR documentation built on May 29, 2024, 7:16 a.m.