Learn R Programming

infoelectoral

[

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.

How to install?

devtools::install_github("ropenspain/infoelectoral")

How to use it

infoelectoral has three functions:

  1. mesas() downloads the electoral results data of the selected election at the polling station level.
  2. municipios() downloads the electoral results data of the selected election at the municipality level.
  3. provincias() downloads the electoral results data of the selected election at the constituency level.
  4. candidatos() downloads the candidates data of the selected elections.

Example

library(infoelectoral)
df <- municipios(tipo_eleccion = "congreso", anno = 1982, mes = "10")

Copy Link

Version

Install

install.packages('infoelectoral')

Monthly Downloads

9

Version

1.0.1

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Héctor Meleiro

Last Published

May 21st, 2024

Functions in infoelectoral (1.0.1)

read06

Reads the candidacy info at municipality level files
read07

Reads the basic data files for the area superior to the municipality (provinces, islands, etc...)
mesas

Download data at the polling station level
read12

Reads the candidacy files for small municipalities
municipios

Download data at the municipality level
candidatos_nosenado

candidatos_nosenado
renta

Mean income at the census section level (INE)
candidatos_senado

candidatos_senado
codigos_ccaa

Administrative codes for spanish autonomous communities.
provincias

Download data at the electoral constituency level (province or island)
read09

Reads the basic polling station data files
read08

Reads the candidacy files at the area superior to the municipality (provinces, islands, etc...)
read03

Reads the candidacy files
candidatos

Download candidate data
codigos_provincias

Administrative codes for spanish provinces.
codigos_partidos

Recoded party names
fechas_elecciones

Election dates
codigos_municipios

Administrative codes for spanish municipalities.
read05

Reads the basic municipal data files
senado_mesas

senado_mesas
read04

Reads the candidates info files
read11

Reads the basic data files for municipalities of 250 inhabitants or less
senado_municipios

senado_municipios
read10

Reads the candidacy info at polling station level files