tseGetFinalAccountability: 'tseGetFinalAccountability' Gets brazilian accountability...

Description Usage Arguments Details Value Examples

View source: R/tseGetFinalAccountability.R

Description

tseGetFinalAccountability Gets brazilian accountability data from the brazilian Supreme Electoral Court (TSE - Tribunal Superior Eleitoral) which is freely available from it's [site]http://www.tse.jus.br/eleicoes.

Usage

1
2
3
4
5
tseGetFinalAccountability(srcLocation = NULL, srcLocationType = "file",
  destLocation = NULL, electionType = "",
  accountabilityType = "Party_Incomes", federativeBody = "BR",
  sinceYear = NA, year = NA, extractZip = F, encoding = "windows-1252",
  dataBaseEnvir)

Arguments

srcLocation

Source location: Depending the value of the srcLocationType parameter, it shall be a path to a file, folder or an http url.

srcLocationType

Source Location Type: can assume any of the following values: file, folder or http. The srcLocation should assume appropriate values.

destLocation

Detination location: should point to a local folder in which the data files will be stored after download or extraction. This is an optional parameter. If left unassigned, the destination will be assumed to be the same as srcLocation, if it points to a valid local folder, or a temporary local folder otherwise.

electionType

Election Type: there are two types od

year

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

encoding

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

Details

The function can download the requested data, extract the csv files from the zipped downloaded file and appropriately read the csv files in accordance with it's layout which is described in a pdf file bundled in the same zipped file. Alternatively it can skip the first (downloading) step and second (zip file extraction) and head straight to the final steps (conversion of the csv files to an R data.frame).

Value

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

Examples

1
2
3
4
5
6
7
8
## Not run: 
dfBaseAP <- tseGetFinalAccountability(
  srcLocationType = 'folder',
  srcLocation = "G:/Contas_TSE",
  accountabilityType = "Despesas_Partidos",
  federativeBody = "AP", year = 2016)

## End(Not run)

brunomssmelo/TseWrangler documentation built on May 11, 2017, 5:43 p.m.