R/make_long.R
make_long.RdFunció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).
make_long(data)
| data | es el tibble que devuelve |
|---|
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).
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).