voter_profile_by_section: Download data on the voters' profile by vote section

Description Usage Arguments Details Value Examples

View source: R/voter_profile_by_section.R

Description

voter_profile_by_section() downloads and cleans data on the voters' profile aggregated by voting section (i.e., voting stations). The function returns a data.frame where each observation corresponds to a voter profile type.

Usage

1
2
3
4
5
6
7
voter_profile_by_section(
  year,
  ascii = FALSE,
  encoding = "windows-1252",
  export = FALSE,
  temp = TRUE
)

Arguments

year

Election year (integer). For this function, the following years are available: 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014, 2016, 2018 and 2020.

ascii

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

encoding

Data original encoding (defaults to 'windows-1252'). 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

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

Examples

1
2
3
4
## Not run: 
df <- voter_profile_by_section(2016)

## End(Not run)

electionsBR documentation built on Jan. 30, 2021, 5:06 p.m.