Skip to content

Commit

Permalink
fix(calcular_incidencia_sex): group data by event and calculation
Browse files Browse the repository at this point in the history
Ref: #108
  • Loading branch information
GeraldineGomez committed Apr 25, 2024
1 parent dfadbb6 commit 61c0d0f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/checking_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,16 @@ calcular_incidencia_sex <- function(data_incidencia,
mpio <- dept_data$codigo_municipio
}
}
cod_eve <- data_agrupada$cod_eve[1]
nombre_evento <- data_agrupada$nombre_evento[1]
data_agrupada <- data_agrupada %>%
group_by_at("sexo") %>%
dplyr::summarise(casos = sum(.data[["casos"]]), .groups = "drop")
cols_eve <- data.frame(cod_eve = rep(cod_eve,
nrow(data_agrupada)),
nombre_evento = rep(nombre_evento,
nrow(data_agrupada)))
data_agrupada <- cbind(data_agrupada, cols_eve)
for (fila in seq_len(nrow(data_agrupada))) {
sex_fila <- data_agrupada[fila, ]
incidencia_sex <- calcular_incidencia(data_incidencia = data_incidencia,
Expand Down

0 comments on commit 61c0d0f

Please sign in to comment.