voter_profile.Rd
voter_profile()
downloads and cleans data on the voters' profile aggregated by state, city and electoral zone.
The function returns a data.frame
where each observation corresponds to a voter profile type.
voter_profile(year, ascii = FALSE, encoding = "windows-1252", export = FALSE)
year | Election year ( |
---|---|
ascii | ( |
encoding | Data original encoding (defaults to 'windows-1252'). This can be changed to avoid errors
when |
export | ( |
voter_profile()
returns a data.frame
with the following variables:
PERIODO: Election year.
UF: Units of the Federation's acronym in which occurred the election.
MUNICIPIO: Municipality name.
COD_MUNICIPIO_TSE: Municipal's Supreme Electoral Court code (number).
NR_ZONA: Electoral zone's Supreme Electoral Court code (number).
SEXO: Voters' sex.
FAIXA_ETARIA: Voters' age group.
GRAU_DE_ESCOLARIDADE: Voters' education degree.
QTD_ELEITORES_NO_PERFIL: Absolute number of voters.
If export is set to TRUE
, the downloaded data is saved as .dta and .sav
files in the current directory.
# NOT RUN { df <- voter_profile(2002) # }