Función que descarga resultados electorales nacionales desde 2007 (Function that downloads national electoral data since 2007)

get_election_data(
  district = NULL,
  category = NULL,
  round = NULL,
  year = NULL,
  level = "provincia",
  long = TRUE,
  raw = FALSE
)

Arguments

district

un character con código para Argentina y las 24 provincias (a named character with code for Argentina and the 24 provinces).

category

un character para la categoría electoral: diputado dip, senador sen o presidente presi (a character with a name for the electoral category: deputy dip, senator sen or president presi).

round

un character para tipo de elección: primaria paso o general gral (a character with a name for the election round: primary paso or general gral).

year

un integer para el año de eleccion (an integer for the year of choice).

level

un character para seleccionar level de agregación de los resultados: provincia, departamento o circuito (a character to select the level of aggregation of the results: province provincia, department -departamento or electoral precints circuito).

long

un boleano para estructura de los datos. Por default long = FALSE (a boolean for data structure. By default long = FALSE).

raw

un boleano TRUE/FALSE que define si descargar base de datos desagregada a nivel MESA o no (a TRUE/FALSE boolean to define whether to download disaggregated data at BALLOT level or not)

Value

devuelve un tibble con class "grouped_df", "tbl_df","tbl", "data.frame" con los resultados de una eleccion determinada (returns a tibble with electoral results of interest with class "grouped_df", "tbl_df","tbl", "data.frame").

See also

Examples

get_election_data(district = "caba", category = "dip", round = "paso", year = 2011, level = "provincia", long = TRUE, raw = FALSE)
#> Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if `.name_repair` is omitted as of tibble 2.0.0. #> Using compatibility `.name_repair`.
#> # A tibble: 14 x 8 #> # Groups: codprov [1] #> category round year codprov name_prov electores listas votos #> <chr> <chr> <dbl> <chr> <chr> <dbl> <chr> <dbl> #> 1 dip paso 2011 01 CABA 2491166 0023 186276 #> 2 dip paso 2011 01 CABA 2491166 0036 68575 #> 3 dip paso 2011 01 CABA 2491166 0179 8234 #> 4 dip paso 2011 01 CABA 2491166 0302 68001 #> 5 dip paso 2011 01 CABA 2491166 0501 509590 #> 6 dip paso 2011 01 CABA 2491166 0504 95714 #> 7 dip paso 2011 01 CABA 2491166 0508 47956 #> 8 dip paso 2011 01 CABA 2491166 0509 145580 #> 9 dip paso 2011 01 CABA 2491166 0510 201173 #> 10 dip paso 2011 01 CABA 2491166 0517 81666 #> 11 dip paso 2011 01 CABA 2491166 0518 294312 #> 12 dip paso 2011 01 CABA 2491166 0536 135361 #> 13 dip paso 2011 01 CABA 2491166 blancos 35478 #> 14 dip paso 2011 01 CABA 2491166 nulos 27459