# infoelectoral [infoelectoral](https://infoelectoral.spainelectoralproject.com/) is a R library that helps retrieve official electoral results for Spain from the [Ministry of the Interior](https://infoelectoral.interior.gob.es/es/inicio/). It allows you to download the results of general, european and municipal elections of any year at the polling station and municipality level. ## Installation You can install the latest stable version from CRAN: ``` r install.packages("infoelectoral") ``` You can install the development version from GitHub: ``` r devtools::install_github("ropenspain/infoelectoral") ``` ## Overview [infoelectoral](https://infoelectoral.spainelectoralproject.com/) has four functions: - [`mesas()`](https://infoelectoral.spainelectoralproject.com/reference/mesas.md) downloads the electoral results data of the selected election at the polling station level. - [`municipios()`](https://infoelectoral.spainelectoralproject.com/reference/municipios.md) downloads the electoral results data of the selected election at the municipality level. - [`provincias()`](https://infoelectoral.spainelectoralproject.com/reference/provincias.md) downloads the electoral results data of the selected election at the constituency level. - [`candidatos()`](https://infoelectoral.spainelectoralproject.com/reference/candidatos.md) downloads the candidates data of the selected elections. The package also includes some [datasets](https://infoelectoral.spainelectoralproject.com/reference/index.html#datasets) with the official names of the territorial units and the election dates. ## Basic usage ``` r library(infoelectoral) df <- municipios(tipo_eleccion = "congreso", anno = 1982, mes = "10") ``` ## Learn more For a a extended example of how all functions work please check the vignettes: - [Get started](https://infoelectoral.spainelectoralproject.com/articles/infoelectoral.html) - [Using infoelectoral to make electoral maps](https://infoelectoral.spainelectoralproject.com/articles/municipios.html) # Package index ## Functions Download, format and import electoral data to the enviroment. - [`municipios()`](https://infoelectoral.spainelectoralproject.com/reference/municipios.md) : Download data at the municipality level - [`mesas()`](https://infoelectoral.spainelectoralproject.com/reference/mesas.md) : Download data at the polling station level - [`provincias()`](https://infoelectoral.spainelectoralproject.com/reference/provincias.md) : Download data at the electoral constituency level (province or island) - [`candidatos()`](https://infoelectoral.spainelectoralproject.com/reference/candidatos.md) : Download candidate data ## Datasets Datasets with the official codes and names of the different administrative levels (autonomous communities, provinces and municipalities). - [`fechas_elecciones`](https://infoelectoral.spainelectoralproject.com/reference/fechas_elecciones.md) : Election dates - [`codigos_ccaa`](https://infoelectoral.spainelectoralproject.com/reference/codigos_ccaa.md) : Administrative codes for spanish autonomous communities. - [`codigos_provincias`](https://infoelectoral.spainelectoralproject.com/reference/codigos_provincias.md) : Administrative codes for spanish provinces. - [`codigos_municipios`](https://infoelectoral.spainelectoralproject.com/reference/codigos_municipios.md) : Administrative codes for spanish municipalities. - [`codigos_partidos`](https://infoelectoral.spainelectoralproject.com/reference/codigos_partidos.md) : Recoded party names - [`renta`](https://infoelectoral.spainelectoralproject.com/reference/renta.md) : Mean income at the census section level (INE) # Articles ### All vignettes - [Get started](https://infoelectoral.spainelectoralproject.com/articles/infoelectoral.md): - [Using infoelectoral to make electoral maps](https://infoelectoral.spainelectoralproject.com/articles/municipios.md):