Returns the territorial summary and per-party vote breakdown for a specific election-territory combination. This is a composite endpoint that returns a named list.
Usage
get_resultado_completo(
eleccion_id,
territorio_id,
...,
denormalize = FALSE,
use_recode = FALSE,
clean = denormalize
)Arguments
- eleccion_id
Integer. The election ID.
- territorio_id
Integer. The territory ID.
- ...
Arguments after
...must be named.- denormalize
Logical. If
TRUE, adds descriptive columns next to ID columns:eleccion_descripcion,territorio_nombre(in bothtotales_territorioandvotos_partido), andpartido_nombre(invotos_partido). Requires additional API calls. DefaultFALSE.- use_recode
Logical. If
TRUEanddenormalize = TRUE, thepartido_nombrecolumn uses the recode group name (agrupacion) instead of the party abbreviation (siglas). Falls back tosiglaswhen the party has no recode. DefaultFALSE.- clean
Logical. If
TRUE, removes ID and slug columns from both sub-tibbles. Defaults to the value ofdenormalize.
Value
A named list with two elements:
totales_territorioA 1-row tibble with summary fields:
id,eleccion_id,territorio_id,censo_ine,participacion_1,participacion_2,participacion_3,votos_validos,abstenciones,votos_blancos,votos_nulos,nrepresentantes.votos_partidoA tibble of per-party votes, sorted by votes descending. Columns:
id,eleccion_id,territorio_id,partido_id,votos,representantes,partido_id,partido_siglas,partido_denominacion,partido_partido_recode_id.
When denormalize = TRUE, additional columns eleccion_descripcion,
territorio_nombre, and partido_nombre (in votos_partido) are inserted.
When clean = TRUE, ID and slug columns are removed.