elections: Get election data

View source: R/qry_elections.R

electionsR Documentation

Get election data

Description

This function gets election data from a repository.

Usage

elections(
  elec,
  year,
  month = NULL,
  ine_geo_code = NULL,
  by = NULL,
  output = "summary"
)

Arguments

elec

Character. Type of election "congreso", "senado", "municipio", "referendum", "europeas", "cabildo"

year

Numeric. Year of the election.

month

Numeric. Month of the election. Only necessary for 2019 "congreso" and "senado". Default is 'NULL'.

ine_geo_code

Character. INE geographical code to retrieve the results from a given area that might include up to "mesa". Default is 'NULL'.

by

Character. Level at which data is retrieved: "nacional", "comunidad", "provincia", "municipio", "distrito", "seccion", "mesa". The level must be at the same or lower level than 'ine_geo_code' if specified. dEfault is 'NULL'.

output

Character. Type of output "summary" (default).

Value

A data frame containing the election results.


pablocal/pablo documentation built on June 14, 2024, 12:16 p.m.