Skip to content

Instantly share code, notes, and snippets.

@gabrielzanlorenssi
Created September 21, 2022 23:59
Show Gist options
  • Save gabrielzanlorenssi/ddae70b839d2bf3650e1e065e27d6af5 to your computer and use it in GitHub Desktop.
Save gabrielzanlorenssi/ddae70b839d2bf3650e1e065e27d6af5 to your computer and use it in GitHub Desktop.
# Library -----------------------------------------------------------------
library(cepespR)
library(tidyverse)
#-- 1998 a 2018
years <- c(1998, 2002, 2006, 2010, 2014, 2018)
d <- map_df(years, function(x) {
get_votes(year=x, position="President") %>%
select(ANO_ELEICAO, NUM_TURNO,
NUMERO_CANDIDATO,
COD_MUN_IBGE, QTDE_VOTOS) %>%
set_names("year", "turno", "numero_cand",
"ibge7", "votos")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment