infoelectoral is a R library that helps retrieve and analize official electoral results for Spain from the Ministry of the Interior. It allows you to download the results of general, european and municipal elections of any year at the polling station and municipality level.
devtools::install_github("ropenspain/infoelectoral")
infoelectoral has three functions:
mesas()
downloads the electoral results data of the selected election at the polling station level.municipios()
downloads the electoral results data of the selected election at the municipality level.provincias()
downloads the electoral results data of the selected election at the constituency level.candidatos()
downloads the candidates data of the selected elections.
library(infoelectoral)
df <- municipios(tipo_eleccion = "congreso", anno = 1982, mes = "10")