Skip to content

Commit

Permalink
fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoZepeda committed Dec 26, 2022
1 parent 92f77b7 commit 4379ed5
Show file tree
Hide file tree
Showing 43 changed files with 107 additions and 93 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: covidmx
Title: Descarga y analiza datos de COVID-19 en México
Version: 0.7.4
Version: 0.7.5
Authors@R:
c(person("Rodrigo", "Zepeda-Tello", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4471-5270")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# covidmx 0.7.5

* Se arregló #13 permitiendo ahora que los marcados con edad de cero años aparezcan. Los cortes de fecha ahora incluyen el límite inferior.

# covidmx 0.7.4

* Se corrige el issue #14 [que devolvía agrupados los dataframes al correr casos y positividad](https://github.com/RodrigoZepeda/covidmx/issues/14).
Expand Down
8 changes: 6 additions & 2 deletions R/casos.R
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,17 @@ casos <- function(datos_covid,
if (!is.null(edad_cut)) {
# Obtenemos los grupos de edad
.casos <- .casos |>
dplyr::mutate(!!as.symbol("EDAD_CAT") := cut(!!as.symbol("EDAD"), breaks = edad_cut)) |>
dplyr::mutate(!!as.symbol("EDAD_CAT") := cut(!!as.symbol("EDAD"),
breaks = edad_cut,
include.lowest = TRUE)) |>
dplyr::filter(!is.na(!!as.symbol("EDAD_CAT")))
}

# Agregamos la entidad a la combinacion si fill zeros
if (fill_zeros & !is.null(edad_cut)) {
.grouping_edad <- dplyr::tibble(EDAD_CAT = cut(edad_cut, breaks = edad_cut)) |>
.grouping_edad <- dplyr::tibble(EDAD_CAT = cut(edad_cut, breaks = edad_cut,
include.lowest = TRUE)) |>
dplyr::distinct() |> #For n = 2, cut repeats the first label so keep only one
dplyr::filter(!is.na(!!as.symbol("EDAD_CAT")))

if (nrow(.grouping_edad) == 0) {
Expand Down
5 changes: 3 additions & 2 deletions R/numero_pruebas.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,14 @@ numero_pruebas <- function(datos_covid,
if (!is.null(edad_cut)) {
.num_pruebas <- .num_pruebas |>
dplyr::mutate(!!as.symbol("EDAD_CAT") := cut(!!as.symbol("EDAD"),
breaks = edad_cut
breaks = edad_cut,
include.lowest = TRUE
)) |>
dplyr::filter(!is.na(!!as.symbol("EDAD_CAT")))
}

# Cortamos la base en tipos de pruebas
is_pcr <- any(stringr::str_detect(tolower(tipo_prueba), "pcr"))
is_pcr <- any(stringr::str_detect(tolower(tipo_prueba), "pcr"))
is_anti <- any(stringr::str_detect(tolower(tipo_prueba), "ant.*geno"))
if (is_pcr) {
.pcr <- .num_pruebas |>
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/articles/CDMX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/articles/Ejemplos_de_analisis.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/Estudio_de_Caso_CDMX.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions docs/articles/Preguntas_Frecuentes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4379ed5

Please sign in to comment.