make_long: Transforma tibble a formato largo (_Transforms a tibble into...

View source: R/make_long.R

make_longR Documentation

Transforma tibble a formato largo (Transforms a tibble into long format)

Description

Función auxiliar que transforma el tibble wide obtenido con get_election_data a long (Auxiliary function that transforms a wide tibble obtained with get_election_data to long format).

Usage

make_long(data)

Arguments

data

es el tibble que devuelve get_election_data con long = FALSE como parámetro (tibble output from get_election_data with long = FALSE as a parameter).

Details

El formato de data debe ser long tanto para calcular compute_nep y compute_competitiveness, como para obtener nombre de listas con get_names (long format of data is required for compute_nep , compute_competitiveness and get_names).

Value

transforma data a formato alargado utilizando pivot_longer sin cambiar class "tbl_df","tbl","data.frame" de origen pero aumentando el número de filas y reduciendo el de columnas (It makes data longer with pivot_longer. It returns data of class "tbl_df","tbl","data.frame" as the original but increasing the number of rows and decreasing the number of columns).


electorArg/polAr documentation built on Oct. 31, 2023, 8:27 a.m.