Skip to content

Commit

Permalink
feat: improved data table and order the content
Browse files Browse the repository at this point in the history
Ref: #108
  • Loading branch information
GeraldineGomez committed Apr 24, 2024
1 parent b47ec0c commit d93fb21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -1313,8 +1313,12 @@ plot_tabla_incidencia_geo <- function(data_agrupada,
"caption_geo_incidence")
data_agrupada[[col_geo]] <-
stringr::str_to_title(data_agrupada[[col_geo]])
data_tabla <- data.frame(data_agrupada[[col_geo]],
data_agrupada[["incidencia"]])
data_tabla <- data_agrupada %>%
group_by_at(c(col_geo, "incidencia")) %>%
dplyr::summarise(incidencia = sum(.data[["incidencia"]]),
.groups = "drop")
data_tabla <- data_tabla[order(data_tabla$incidencia,
decreasing = TRUE), ]
tabla_tipos <- knitr::kable(data_tabla,
col.names = c(geo_etiqueta, "Incidencia"),
align = "c",
Expand Down

0 comments on commit d93fb21

Please sign in to comment.