Utilizando la informacion brindada por la Secretaria de Salud Federal sobre los casos de COVID-19 detectados en la Republica Mexicana, y considerando solamente los casos positivos (verificar que la informaci´on que se obtenga de la base de datos sea igual a la reportada diariamente por dicha secretaria), obtener lo siguiente.
Eligiendo un estado de la republica de residencia del paciente que tenga mas de 20 municipios, obtener (tablas):
% de defunciones por municipio (total de defunciones / total de casos positivos)
Se carga la base de datos y se filtra (usando la funcion which) para obtener solo los datos del estado seleccionado, en este caso Zacatecas:
datos_zac <- datos %>% dplyr::filter(ENTIDAD_RES=="32")
write.csv(datos_zac[,],file="datos_zac.csv")
datos_zac<-read.csv("datos_zac.csv")
datos_zac <- datos_zac[,-1]
De los datos de Zacatecas (datos_zac) se filtran de defunciones en el estado:
datos_def <- datos_zac[,c(9, 13, 36)]
datos_def$FECHA_DEF <- (datos_def$FECHA_DEF)
datos_def$FECHA_DEF <- ifelse(datos_def$FECHA_DEF == "9999-99-99", 0, 1)
Para obtener las defunciones por municipio primero se obtiene una tabla con el nombre de los municipios:
catalo_muni <- read_excel("C:\\Users\\richa\\OneDrive - CIDE\\1er Semestre-DESKTOP-RPQUJJA\\Manejo de bases de datos\\Examen\\catalogo.xlsx", sheet = "Catálogo MUNICIPIOS")
catalo_muni_zac_temp <- which(catalo_muni$CLAVE_ENTIDAD == "32")
catalo_muni_zac_temp2 <- catalo_muni[catalo_muni_zac_temp,]
catalo_muni_zac <- catalo_muni_zac_temp2[,c(1,2)]
La tabla con el nombre de los municipios se empata con la clave de cada municipio para vincular cada defuncion con el municipio de residencia del difunto:
descriptores <- read_excel("C:\\Users\\richa\\OneDrive - CIDE\\1er Semestre-DESKTOP-RPQUJJA\\Manejo de bases de datos\\Examen\\descriptores.xlsx")
tabla_muni <- merge(datos_def, catalo_muni_zac, by.x = "MUNICIPIO_RES", by.y = "CLAVE_MUNICIPIO", sort = FALSE)
tabla_muni$FECHA_DEF <- as.numeric(tabla_muni$FECHA_DEF)
tabla_muni$CLASIFICACION_FINAL <- as.numeric(tabla_muni$CLASIFICACION_FINAL)
Con la funcion aggregate se agrupan las defunciones por cada municipio:
defunciones <- as.data.frame(aggregate(FECHA_DEF~MUNICIPIO, data=tabla_muni, sum))
defunciones %>%
kbl() %>%
kable_styling("hover", full_width = F)
| MUNICIPIO | FECHA_DEF |
|---|---|
| APOZOL | 6 |
| APULCO | 5 |
| ATOLINGA | 9 |
| BENITO JUÁREZ | 6 |
| CALERA | 85 |
| CAÑITAS DE FELIPE PESCADOR | 20 |
| CHALCHIHUITES | 17 |
| CONCEPCIÓN DEL ORO | 47 |
| CUAUHTÉMOC | 22 |
| EL PLATEADO DE JOAQUÍN AMARO | 4 |
| EL SALVADOR | 2 |
| FRESNILLO | 769 |
| GENARO CODINA | 14 |
| GENERAL ENRIQUE ESTRADA | 14 |
| GENERAL FRANCISCO R. MURGUÍA | 40 |
| GENERAL PÁNFILO NATERA | 50 |
| GUADALUPE | 527 |
| HUANUSCO | 8 |
| JALPA | 22 |
| JEREZ | 228 |
| JIMÉNEZ DEL TEUL | 2 |
| JUAN ALDAMA | 41 |
| JUCHIPILA | 17 |
| LORETO | 92 |
| LUIS MOYA | 23 |
| MAZAPIL | 33 |
| MELCHOR OCAMPO | 7 |
| MEZQUITAL DEL ORO | 4 |
| MIGUEL AUZA | 30 |
| MOMAX | 3 |
| MONTE ESCOBEDO | 14 |
| MORELOS | 48 |
| MOYAHUA DE ESTRADA | 9 |
| NO ESPECIFICADO | 0 |
| NOCHISTLÁN DE MEJÍA | 45 |
| NORIA DE ÁNGELES | 23 |
| OJOCALIENTE | 91 |
| PÁNUCO | 39 |
| PINOS | 127 |
| RÍO GRANDE | 172 |
| SAIN ALTO | 39 |
| SANTA MARÍA DE LA PAZ | 5 |
| SOMBRERETE | 130 |
| SUSTICACÁN | 3 |
| TABASCO | 19 |
| TEPECHITLÁN | 15 |
| TEPETONGO | 26 |
| TEÚL DE GONZÁLEZ ORTEGA | 4 |
| TLALTENANGO DE SÁNCHEZ ROMÁN | 68 |
| TRANCOSO | 56 |
| TRINIDAD GARCÍA DE LA CADENA | 2 |
| VALPARAÍSO | 74 |
| VETAGRANDE | 29 |
| VILLA DE COS | 75 |
| VILLA GARCÍA | 23 |
| VILLA GONZÁLEZ ORTEGA | 28 |
| VILLA HIDALGO | 37 |
| VILLANUEVA | 77 |
| ZACATECAS | 810 |
Para obtener el numero de casos confirmados, de la tabla con la informacion municipal se filtran las claves que conllevan a un caso confirmado:
for (x in 1:103126) {
if(tabla_muni[x,3]== "1" | tabla_muni[x,3]== "2" |tabla_muni[x,3]== "3")
{
tabla_muni[x,3] <- 1
}
else
{
tabla_muni[x,3] <- 0
}
}
Se genera la tabla con los casos confirmados por municipio y se junta con las defunciones para obtener la proporcion de defunciones respectados a los casos confirmados:
prop_def <- as.data.frame(aggregate(CLASIFICACION_FINAL~MUNICIPIO, data = tabla_muni, sum ))
prop_def$DEFUNCIONES <- defunciones[,2]
prop_def$PORCENTAJE <- round((prop_def$DEFUNCIONES/prop_def$CLASIFICACION_FINAL)*100, 2)
prop_def %>%
kbl() %>%
kable_styling("hover", full_width = F)
| MUNICIPIO | CLASIFICACION_FINAL | DEFUNCIONES | PORCENTAJE |
|---|---|---|---|
| APOZOL | 42 | 6 | 14.29 |
| APULCO | 32 | 5 | 15.62 |
| ATOLINGA | 53 | 9 | 16.98 |
| BENITO JUÁREZ | 47 | 6 | 12.77 |
| CALERA | 757 | 85 | 11.23 |
| CAÑITAS DE FELIPE PESCADOR | 71 | 20 | 28.17 |
| CHALCHIHUITES | 64 | 17 | 26.56 |
| CONCEPCIÓN DEL ORO | 507 | 47 | 9.27 |
| CUAUHTÉMOC | 90 | 22 | 24.44 |
| EL PLATEADO DE JOAQUÍN AMARO | 11 | 4 | 36.36 |
| EL SALVADOR | 28 | 2 | 7.14 |
| FRESNILLO | 7373 | 769 | 10.43 |
| GENARO CODINA | 83 | 14 | 16.87 |
| GENERAL ENRIQUE ESTRADA | 86 | 14 | 16.28 |
| GENERAL FRANCISCO R. MURGUÍA | 197 | 40 | 20.30 |
| GENERAL PÁNFILO NATERA | 231 | 50 | 21.65 |
| GUADALUPE | 9237 | 527 | 5.71 |
| HUANUSCO | 54 | 8 | 14.81 |
| JALPA | 454 | 22 | 4.85 |
| JEREZ | 1424 | 228 | 16.01 |
| JIMÉNEZ DEL TEUL | 27 | 2 | 7.41 |
| JUAN ALDAMA | 193 | 41 | 21.24 |
| JUCHIPILA | 130 | 17 | 13.08 |
| LORETO | 538 | 92 | 17.10 |
| LUIS MOYA | 94 | 23 | 24.47 |
| MAZAPIL | 292 | 33 | 11.30 |
| MELCHOR OCAMPO | 13 | 7 | 53.85 |
| MEZQUITAL DEL ORO | 16 | 4 | 25.00 |
| MIGUEL AUZA | 156 | 30 | 19.23 |
| MOMAX | 110 | 3 | 2.73 |
| MONTE ESCOBEDO | 237 | 14 | 5.91 |
| MORELOS | 374 | 48 | 12.83 |
| MOYAHUA DE ESTRADA | 21 | 9 | 42.86 |
| NO ESPECIFICADO | 1 | 0 | 0.00 |
| NOCHISTLÁN DE MEJÍA | 1313 | 45 | 3.43 |
| NORIA DE ÁNGELES | 112 | 23 | 20.54 |
| OJOCALIENTE | 581 | 91 | 15.66 |
| PÁNUCO | 172 | 39 | 22.67 |
| PINOS | 549 | 127 | 23.13 |
| RÍO GRANDE | 768 | 172 | 22.40 |
| SAIN ALTO | 130 | 39 | 30.00 |
| SANTA MARÍA DE LA PAZ | 41 | 5 | 12.20 |
| SOMBRERETE | 1677 | 130 | 7.75 |
| SUSTICACÁN | 18 | 3 | 16.67 |
| TABASCO | 276 | 19 | 6.88 |
| TEPECHITLÁN | 193 | 15 | 7.77 |
| TEPETONGO | 97 | 26 | 26.80 |
| TEÚL DE GONZÁLEZ ORTEGA | 183 | 4 | 2.19 |
| TLALTENANGO DE SÁNCHEZ ROMÁN | 946 | 68 | 7.19 |
| TRANCOSO | 309 | 56 | 18.12 |
| TRINIDAD GARCÍA DE LA CADENA | 43 | 2 | 4.65 |
| VALPARAÍSO | 240 | 74 | 30.83 |
| VETAGRANDE | 141 | 29 | 20.57 |
| VILLA DE COS | 446 | 75 | 16.82 |
| VILLA GARCÍA | 110 | 23 | 20.91 |
| VILLA GONZÁLEZ ORTEGA | 151 | 28 | 18.54 |
| VILLA HIDALGO | 127 | 37 | 29.13 |
| VILLANUEVA | 537 | 77 | 14.34 |
| ZACATECAS | 10135 | 810 | 7.99 |
% de casos positivos con al menos una comorbilidad a nivel municipal.
De los datos de Zacatecas (datos_zac) se filtran los 10 tipos de comorbilidades en el estado:
datos_comorb2 <- datos_zac[,c(9, 21:29, 36)]
datos_comorb2[,2:10] <- ifelse(datos_comorb2[,2:10]==1,1,0)
Se suman los renglones de los 9 tipos de comorbilidad para identificar cada registro que tenga al menos una comorbilidad:
for (x in 1:103126) {
datos_comorb2[x,12] <- sum(datos_comorb2[x,2:10])
}
datos_comorb2$V12 <- ifelse(datos_comorb2$V12 >= 1, 1, 0)
Se suman las columnas de comorbilidad y positivos para identificar cada registro que tenga al menos una comorbilidad y sean casos confirmados:
datos_comorb2$CLASIFICACION_FINAL <- tabla_muni$CLASIFICACION_FINAL
datos_comorb2$COMORB_POSI <- datos_comorb2$CLASIFICACION_FINAL+datos_comorb2$V12
Para identificar si los casos positivos tuvieron al menos una comorbilidad se toma en cuenta la suma anterios:
datos_comorb2$COMORB_POSI <- ifelse(datos_comorb2$COMORB_POSI == 2, 1, 0)
Con los datos obtenidos se elabora la tabla que identifica por municipio cuantas personas tienen al menos una comorbilidad:
tabla_comorb <- merge(datos_comorb2, catalo_muni_zac, by.x = "MUNICIPIO_RES", by.y = "CLAVE_MUNICIPIO", sort = FALSE)
comorb <- as.data.frame(aggregate(COMORB_POSI~MUNICIPIO, data=tabla_comorb, sum))
comorb %>%
kbl() %>%
kable_styling("hover", full_width = F)
| MUNICIPIO | COMORB_POSI |
|---|---|
| APOZOL | 13 |
| APULCO | 11 |
| ATOLINGA | 17 |
| BENITO JUÁREZ | 13 |
| CALERA | 248 |
| CAÑITAS DE FELIPE PESCADOR | 31 |
| CHALCHIHUITES | 27 |
| CONCEPCIÓN DEL ORO | 143 |
| CUAUHTÉMOC | 29 |
| EL PLATEADO DE JOAQUÍN AMARO | 5 |
| EL SALVADOR | 9 |
| FRESNILLO | 2360 |
| GENARO CODINA | 25 |
| GENERAL ENRIQUE ESTRADA | 25 |
| GENERAL FRANCISCO R. MURGUÍA | 44 |
| GENERAL PÁNFILO NATERA | 77 |
| GUADALUPE | 2708 |
| HUANUSCO | 15 |
| JALPA | 118 |
| JEREZ | 415 |
| JIMÉNEZ DEL TEUL | 10 |
| JUAN ALDAMA | 60 |
| JUCHIPILA | 34 |
| LORETO | 212 |
| LUIS MOYA | 45 |
| MAZAPIL | 65 |
| MELCHOR OCAMPO | 10 |
| MEZQUITAL DEL ORO | 3 |
| MIGUEL AUZA | 46 |
| MOMAX | 28 |
| MONTE ESCOBEDO | 65 |
| MORELOS | 121 |
| MOYAHUA DE ESTRADA | 5 |
| NO ESPECIFICADO | 1 |
| NOCHISTLÁN DE MEJÍA | 301 |
| NORIA DE ÁNGELES | 42 |
| OJOCALIENTE | 202 |
| PÁNUCO | 59 |
| PINOS | 216 |
| RÍO GRANDE | 297 |
| SAIN ALTO | 45 |
| SANTA MARÍA DE LA PAZ | 12 |
| SOMBRERETE | 338 |
| SUSTICACÁN | 1 |
| TABASCO | 76 |
| TEPECHITLÁN | 57 |
| TEPETONGO | 40 |
| TEÚL DE GONZÁLEZ ORTEGA | 56 |
| TLALTENANGO DE SÁNCHEZ ROMÁN | 260 |
| TRANCOSO | 122 |
| TRINIDAD GARCÍA DE LA CADENA | 10 |
| VALPARAÍSO | 87 |
| VETAGRANDE | 48 |
| VILLA DE COS | 132 |
| VILLA GARCÍA | 34 |
| VILLA GONZÁLEZ ORTEGA | 43 |
| VILLA HIDALGO | 57 |
| VILLANUEVA | 201 |
| ZACATECAS | 3045 |
Se obtiene, por municipio, el numero de casos confimados y se agrega a la tabla anterior para generar el pocentaje de personas que se contagiaron y tienen al menos una comorbilidad:
comorb$CONFIRMADOS <- prop_def$CLASIFICACION_FINAL
comorb$PORC_COMORB <- round((comorb$COMORB_POSI/comorb$CONFIRMADOS)*100,2)
comorb %>%
kbl() %>%
kable_styling("hover", full_width = F)
| MUNICIPIO | COMORB_POSI | CONFIRMADOS | PORC_COMORB |
|---|---|---|---|
| APOZOL | 13 | 42 | 30.95 |
| APULCO | 11 | 32 | 34.38 |
| ATOLINGA | 17 | 53 | 32.08 |
| BENITO JUÁREZ | 13 | 47 | 27.66 |
| CALERA | 248 | 757 | 32.76 |
| CAÑITAS DE FELIPE PESCADOR | 31 | 71 | 43.66 |
| CHALCHIHUITES | 27 | 64 | 42.19 |
| CONCEPCIÓN DEL ORO | 143 | 507 | 28.21 |
| CUAUHTÉMOC | 29 | 90 | 32.22 |
| EL PLATEADO DE JOAQUÍN AMARO | 5 | 11 | 45.45 |
| EL SALVADOR | 9 | 28 | 32.14 |
| FRESNILLO | 2360 | 7373 | 32.01 |
| GENARO CODINA | 25 | 83 | 30.12 |
| GENERAL ENRIQUE ESTRADA | 25 | 86 | 29.07 |
| GENERAL FRANCISCO R. MURGUÍA | 44 | 197 | 22.34 |
| GENERAL PÁNFILO NATERA | 77 | 231 | 33.33 |
| GUADALUPE | 2708 | 9237 | 29.32 |
| HUANUSCO | 15 | 54 | 27.78 |
| JALPA | 118 | 454 | 25.99 |
| JEREZ | 415 | 1424 | 29.14 |
| JIMÉNEZ DEL TEUL | 10 | 27 | 37.04 |
| JUAN ALDAMA | 60 | 193 | 31.09 |
| JUCHIPILA | 34 | 130 | 26.15 |
| LORETO | 212 | 538 | 39.41 |
| LUIS MOYA | 45 | 94 | 47.87 |
| MAZAPIL | 65 | 292 | 22.26 |
| MELCHOR OCAMPO | 10 | 13 | 76.92 |
| MEZQUITAL DEL ORO | 3 | 16 | 18.75 |
| MIGUEL AUZA | 46 | 156 | 29.49 |
| MOMAX | 28 | 110 | 25.45 |
| MONTE ESCOBEDO | 65 | 237 | 27.43 |
| MORELOS | 121 | 374 | 32.35 |
| MOYAHUA DE ESTRADA | 5 | 21 | 23.81 |
| NO ESPECIFICADO | 1 | 1 | 100.00 |
| NOCHISTLÁN DE MEJÍA | 301 | 1313 | 22.92 |
| NORIA DE ÁNGELES | 42 | 112 | 37.50 |
| OJOCALIENTE | 202 | 581 | 34.77 |
| PÁNUCO | 59 | 172 | 34.30 |
| PINOS | 216 | 549 | 39.34 |
| RÍO GRANDE | 297 | 768 | 38.67 |
| SAIN ALTO | 45 | 130 | 34.62 |
| SANTA MARÍA DE LA PAZ | 12 | 41 | 29.27 |
| SOMBRERETE | 338 | 1677 | 20.16 |
| SUSTICACÁN | 1 | 18 | 5.56 |
| TABASCO | 76 | 276 | 27.54 |
| TEPECHITLÁN | 57 | 193 | 29.53 |
| TEPETONGO | 40 | 97 | 41.24 |
| TEÚL DE GONZÁLEZ ORTEGA | 56 | 183 | 30.60 |
| TLALTENANGO DE SÁNCHEZ ROMÁN | 260 | 946 | 27.48 |
| TRANCOSO | 122 | 309 | 39.48 |
| TRINIDAD GARCÍA DE LA CADENA | 10 | 43 | 23.26 |
| VALPARAÍSO | 87 | 240 | 36.25 |
| VETAGRANDE | 48 | 141 | 34.04 |
| VILLA DE COS | 132 | 446 | 29.60 |
| VILLA GARCÍA | 34 | 110 | 30.91 |
| VILLA GONZÁLEZ ORTEGA | 43 | 151 | 28.48 |
| VILLA HIDALGO | 57 | 127 | 44.88 |
| VILLANUEVA | 201 | 537 | 37.43 |
| ZACATECAS | 3045 | 10135 | 30.04 |
Total de casos positivos acumulados por dıa a nivel estatal.
De la informacion anterior, se toma la columna que registra las fechas de ingreso, despues se genera una columna con los datos de los confirmados positivos y se hace la tabla agregando el numero de confirmados segun la fecha para obtenerlos por dia a nivel estatal:
tabla_posi <- as.data.frame(tabla_muni$CLASIFICACION_FINAL)
tabla_posi$FECHA <- datos_zac$FECHA_INGRESO
POSITIVOS <- aggregate(tabla_muni$CLASIFICACION_FINAL~FECHA,data=tabla_posi,sum)
POSITIVOS %>%
kbl() %>%
kable_styling("hover", full_width = F)
| FECHA | tabla_muni$CLASIFICACION_FINAL |
|---|---|
| 2020-01-01 | 1 |
| 2020-01-02 | 0 |
| 2020-01-03 | 0 |
| 2020-01-04 | 1 |
| 2020-01-05 | 0 |
| 2020-01-06 | 1 |
| 2020-01-07 | 1 |
| 2020-01-08 | 3 |
| 2020-01-09 | 1 |
| 2020-01-10 | 2 |
| 2020-01-11 | 2 |
| 2020-01-12 | 4 |
| 2020-01-13 | 3 |
| 2020-01-14 | 3 |
| 2020-01-15 | 2 |
| 2020-01-16 | 3 |
| 2020-01-17 | 1 |
| 2020-01-18 | 1 |
| 2020-01-19 | 1 |
| 2020-01-20 | 3 |
| 2020-01-21 | 2 |
| 2020-01-22 | 5 |
| 2020-01-23 | 2 |
| 2020-01-24 | 4 |
| 2020-01-25 | 0 |
| 2020-01-26 | 2 |
| 2020-01-27 | 6 |
| 2020-01-28 | 6 |
| 2020-01-29 | 0 |
| 2020-01-30 | 5 |
| 2020-01-31 | 4 |
| 2020-02-01 | 0 |
| 2020-02-02 | 0 |
| 2020-02-03 | 3 |
| 2020-02-04 | 5 |
| 2020-02-05 | 1 |
| 2020-02-06 | 5 |
| 2020-02-07 | 6 |
| 2020-02-08 | 1 |
| 2020-02-09 | 3 |
| 2020-02-10 | 7 |
| 2020-02-11 | 4 |
| 2020-02-12 | 7 |
| 2020-02-13 | 2 |
| 2020-02-14 | 3 |
| 2020-02-15 | 2 |
| 2020-02-16 | 1 |
| 2020-02-17 | 2 |
| 2020-02-18 | 4 |
| 2020-02-19 | 8 |
| 2020-02-20 | 2 |
| 2020-02-21 | 3 |
| 2020-02-22 | 2 |
| 2020-02-23 | 3 |
| 2020-02-24 | 7 |
| 2020-02-25 | 8 |
| 2020-02-26 | 8 |
| 2020-02-27 | 4 |
| 2020-02-28 | 2 |
| 2020-02-29 | 0 |
| 2020-03-02 | 5 |
| 2020-03-03 | 2 |
| 2020-03-04 | 4 |
| 2020-03-05 | 3 |
| 2020-03-06 | 1 |
| 2020-03-07 | 1 |
| 2020-03-08 | 2 |
| 2020-03-09 | 4 |
| 2020-03-10 | 3 |
| 2020-03-11 | 6 |
| 2020-03-12 | 3 |
| 2020-03-13 | 3 |
| 2020-03-14 | 0 |
| 2020-03-15 | 1 |
| 2020-03-16 | 3 |
| 2020-03-17 | 9 |
| 2020-03-18 | 6 |
| 2020-03-19 | 7 |
| 2020-03-20 | 10 |
| 2020-03-21 | 6 |
| 2020-03-22 | 5 |
| 2020-03-23 | 11 |
| 2020-03-24 | 13 |
| 2020-03-25 | 7 |
| 2020-03-26 | 7 |
| 2020-03-27 | 5 |
| 2020-03-28 | 1 |
| 2020-03-29 | 1 |
| 2020-03-30 | 6 |
| 2020-03-31 | 5 |
| 2020-04-01 | 3 |
| 2020-04-02 | 12 |
| 2020-04-03 | 4 |
| 2020-04-04 | 8 |
| 2020-04-05 | 2 |
| 2020-04-06 | 5 |
| 2020-04-07 | 7 |
| 2020-04-08 | 13 |
| 2020-04-09 | 5 |
| 2020-04-10 | 2 |
| 2020-04-11 | 1 |
| 2020-04-12 | 2 |
| 2020-04-13 | 3 |
| 2020-04-14 | 8 |
| 2020-04-15 | 16 |
| 2020-04-16 | 12 |
| 2020-04-17 | 16 |
| 2020-04-18 | 23 |
| 2020-04-19 | 5 |
| 2020-04-20 | 14 |
| 2020-04-21 | 9 |
| 2020-04-22 | 8 |
| 2020-04-23 | 11 |
| 2020-04-24 | 16 |
| 2020-04-25 | 5 |
| 2020-04-26 | 14 |
| 2020-04-27 | 19 |
| 2020-04-28 | 18 |
| 2020-04-29 | 9 |
| 2020-04-30 | 7 |
| 2020-05-01 | 10 |
| 2020-05-02 | 9 |
| 2020-05-03 | 2 |
| 2020-05-04 | 11 |
| 2020-05-05 | 9 |
| 2020-05-06 | 7 |
| 2020-05-07 | 29 |
| 2020-05-08 | 23 |
| 2020-05-09 | 6 |
| 2020-05-10 | 10 |
| 2020-05-11 | 24 |
| 2020-05-12 | 22 |
| 2020-05-13 | 26 |
| 2020-05-14 | 33 |
| 2020-05-15 | 26 |
| 2020-05-16 | 6 |
| 2020-05-17 | 8 |
| 2020-05-18 | 29 |
| 2020-05-19 | 13 |
| 2020-05-20 | 19 |
| 2020-05-21 | 7 |
| 2020-05-22 | 18 |
| 2020-05-23 | 7 |
| 2020-05-24 | 8 |
| 2020-05-25 | 14 |
| 2020-05-26 | 23 |
| 2020-05-27 | 17 |
| 2020-05-28 | 19 |
| 2020-05-29 | 23 |
| 2020-05-30 | 11 |
| 2020-05-31 | 4 |
| 2020-06-01 | 14 |
| 2020-06-02 | 15 |
| 2020-06-03 | 22 |
| 2020-06-04 | 20 |
| 2020-06-05 | 19 |
| 2020-06-06 | 13 |
| 2020-06-07 | 3 |
| 2020-06-08 | 16 |
| 2020-06-09 | 36 |
| 2020-06-10 | 25 |
| 2020-06-11 | 20 |
| 2020-06-12 | 49 |
| 2020-06-13 | 19 |
| 2020-06-14 | 10 |
| 2020-06-15 | 36 |
| 2020-06-16 | 45 |
| 2020-06-17 | 33 |
| 2020-06-18 | 22 |
| 2020-06-19 | 27 |
| 2020-06-20 | 5 |
| 2020-06-21 | 8 |
| 2020-06-22 | 34 |
| 2020-06-23 | 34 |
| 2020-06-24 | 24 |
| 2020-06-25 | 38 |
| 2020-06-26 | 29 |
| 2020-06-27 | 17 |
| 2020-06-28 | 17 |
| 2020-06-29 | 49 |
| 2020-06-30 | 44 |
| 2020-07-01 | 41 |
| 2020-07-02 | 43 |
| 2020-07-03 | 38 |
| 2020-07-04 | 18 |
| 2020-07-05 | 27 |
| 2020-07-06 | 45 |
| 2020-07-07 | 42 |
| 2020-07-08 | 47 |
| 2020-07-09 | 53 |
| 2020-07-10 | 49 |
| 2020-07-11 | 45 |
| 2020-07-12 | 33 |
| 2020-07-13 | 38 |
| 2020-07-14 | 48 |
| 2020-07-15 | 57 |
| 2020-07-16 | 61 |
| 2020-07-17 | 37 |
| 2020-07-18 | 24 |
| 2020-07-19 | 24 |
| 2020-07-20 | 60 |
| 2020-07-21 | 76 |
| 2020-07-22 | 65 |
| 2020-07-23 | 72 |
| 2020-07-24 | 56 |
| 2020-07-25 | 30 |
| 2020-07-26 | 25 |
| 2020-07-27 | 50 |
| 2020-07-28 | 102 |
| 2020-07-29 | 63 |
| 2020-07-30 | 84 |
| 2020-07-31 | 52 |
| 2020-08-01 | 39 |
| 2020-08-02 | 22 |
| 2020-08-03 | 70 |
| 2020-08-04 | 72 |
| 2020-08-05 | 72 |
| 2020-08-06 | 62 |
| 2020-08-07 | 60 |
| 2020-08-08 | 53 |
| 2020-08-09 | 29 |
| 2020-08-10 | 96 |
| 2020-08-11 | 101 |
| 2020-08-12 | 92 |
| 2020-08-13 | 55 |
| 2020-08-14 | 74 |
| 2020-08-15 | 53 |
| 2020-08-16 | 40 |
| 2020-08-17 | 81 |
| 2020-08-18 | 94 |
| 2020-08-19 | 68 |
| 2020-08-20 | 92 |
| 2020-08-21 | 73 |
| 2020-08-22 | 39 |
| 2020-08-23 | 31 |
| 2020-08-24 | 65 |
| 2020-08-25 | 82 |
| 2020-08-26 | 60 |
| 2020-08-27 | 81 |
| 2020-08-28 | 85 |
| 2020-08-29 | 41 |
| 2020-08-30 | 21 |
| 2020-08-31 | 72 |
| 2020-09-01 | 92 |
| 2020-09-02 | 104 |
| 2020-09-03 | 52 |
| 2020-09-04 | 92 |
| 2020-09-05 | 43 |
| 2020-09-06 | 24 |
| 2020-09-07 | 77 |
| 2020-09-08 | 81 |
| 2020-09-09 | 80 |
| 2020-09-10 | 77 |
| 2020-09-11 | 72 |
| 2020-09-12 | 36 |
| 2020-09-13 | 31 |
| 2020-09-14 | 84 |
| 2020-09-15 | 69 |
| 2020-09-16 | 31 |
| 2020-09-17 | 81 |
| 2020-09-18 | 56 |
| 2020-09-19 | 32 |
| 2020-09-20 | 17 |
| 2020-09-21 | 66 |
| 2020-09-22 | 67 |
| 2020-09-23 | 67 |
| 2020-09-24 | 59 |
| 2020-09-25 | 70 |
| 2020-09-26 | 27 |
| 2020-09-27 | 21 |
| 2020-09-28 | 69 |
| 2020-09-29 | 124 |
| 2020-09-30 | 74 |
| 2020-10-01 | 76 |
| 2020-10-02 | 78 |
| 2020-10-03 | 31 |
| 2020-10-04 | 36 |
| 2020-10-05 | 75 |
| 2020-10-06 | 87 |
| 2020-10-07 | 74 |
| 2020-10-08 | 63 |
| 2020-10-09 | 61 |
| 2020-10-10 | 55 |
| 2020-10-11 | 52 |
| 2020-10-12 | 88 |
| 2020-10-13 | 116 |
| 2020-10-14 | 99 |
| 2020-10-15 | 88 |
| 2020-10-16 | 133 |
| 2020-10-17 | 48 |
| 2020-10-18 | 31 |
| 2020-10-19 | 91 |
| 2020-10-20 | 116 |
| 2020-10-21 | 142 |
| 2020-10-22 | 115 |
| 2020-10-23 | 105 |
| 2020-10-24 | 57 |
| 2020-10-25 | 42 |
| 2020-10-26 | 129 |
| 2020-10-27 | 148 |
| 2020-10-28 | 129 |
| 2020-10-29 | 137 |
| 2020-10-30 | 95 |
| 2020-10-31 | 39 |
| 2020-11-01 | 29 |
| 2020-11-02 | 93 |
| 2020-11-03 | 125 |
| 2020-11-04 | 140 |
| 2020-11-05 | 202 |
| 2020-11-06 | 176 |
| 2020-11-07 | 82 |
| 2020-11-08 | 54 |
| 2020-11-09 | 134 |
| 2020-11-10 | 192 |
| 2020-11-11 | 137 |
| 2020-11-12 | 160 |
| 2020-11-13 | 173 |
| 2020-11-14 | 54 |
| 2020-11-15 | 54 |
| 2020-11-16 | 65 |
| 2020-11-17 | 136 |
| 2020-11-18 | 174 |
| 2020-11-19 | 171 |
| 2020-11-20 | 186 |
| 2020-11-21 | 48 |
| 2020-11-22 | 49 |
| 2020-11-23 | 144 |
| 2020-11-24 | 178 |
| 2020-11-25 | 174 |
| 2020-11-26 | 172 |
| 2020-11-27 | 143 |
| 2020-11-28 | 58 |
| 2020-11-29 | 50 |
| 2020-11-30 | 123 |
| 2020-12-01 | 203 |
| 2020-12-02 | 110 |
| 2020-12-03 | 140 |
| 2020-12-04 | 121 |
| 2020-12-05 | 42 |
| 2020-12-06 | 32 |
| 2020-12-07 | 147 |
| 2020-12-08 | 132 |
| 2020-12-09 | 109 |
| 2020-12-10 | 140 |
| 2020-12-11 | 87 |
| 2020-12-12 | 37 |
| 2020-12-13 | 54 |
| 2020-12-14 | 101 |
| 2020-12-15 | 141 |
| 2020-12-16 | 79 |
| 2020-12-17 | 124 |
| 2020-12-18 | 80 |
| 2020-12-19 | 44 |
| 2020-12-20 | 47 |
| 2020-12-21 | 106 |
| 2020-12-22 | 133 |
| 2020-12-23 | 71 |
| 2020-12-24 | 57 |
| 2020-12-25 | 10 |
| 2020-12-26 | 27 |
| 2020-12-27 | 29 |
| 2020-12-28 | 116 |
| 2020-12-29 | 120 |
| 2020-12-30 | 106 |
| 2020-12-31 | 82 |
| 2021-01-01 | 11 |
| 2021-01-02 | 35 |
| 2021-01-03 | 15 |
| 2021-01-04 | 94 |
| 2021-01-05 | 146 |
| 2021-01-06 | 110 |
| 2021-01-07 | 162 |
| 2021-01-08 | 127 |
| 2021-01-09 | 57 |
| 2021-01-10 | 32 |
| 2021-01-11 | 130 |
| 2021-01-12 | 142 |
| 2021-01-13 | 122 |
| 2021-01-14 | 124 |
| 2021-01-15 | 78 |
| 2021-01-16 | 37 |
| 2021-01-17 | 32 |
| 2021-01-18 | 107 |
| 2021-01-19 | 169 |
| 2021-01-20 | 120 |
| 2021-01-21 | 126 |
| 2021-01-22 | 99 |
| 2021-01-23 | 41 |
| 2021-01-24 | 29 |
| 2021-01-25 | 96 |
| 2021-01-26 | 151 |
| 2021-01-27 | 130 |
| 2021-01-28 | 121 |
| 2021-01-29 | 98 |
| 2021-01-30 | 28 |
| 2021-01-31 | 26 |
| 2021-02-01 | 50 |
| 2021-02-02 | 100 |
| 2021-02-03 | 122 |
| 2021-02-04 | 113 |
| 2021-02-05 | 85 |
| 2021-02-06 | 24 |
| 2021-02-07 | 26 |
| 2021-02-08 | 102 |
| 2021-02-09 | 115 |
| 2021-02-10 | 97 |
| 2021-02-11 | 98 |
| 2021-02-12 | 62 |
| 2021-02-13 | 37 |
| 2021-02-14 | 17 |
| 2021-02-15 | 122 |
| 2021-02-16 | 133 |
| 2021-02-17 | 75 |
| 2021-02-18 | 90 |
| 2021-02-19 | 85 |
| 2021-02-20 | 32 |
| 2021-02-21 | 12 |
| 2021-02-22 | 82 |
| 2021-02-23 | 75 |
| 2021-02-24 | 88 |
| 2021-02-25 | 74 |
| 2021-02-26 | 70 |
| 2021-02-27 | 28 |
| 2021-02-28 | 24 |
| 2021-03-01 | 87 |
| 2021-03-02 | 94 |
| 2021-03-03 | 78 |
| 2021-03-04 | 83 |
| 2021-03-05 | 92 |
| 2021-03-06 | 29 |
| 2021-03-07 | 34 |
| 2021-03-08 | 73 |
| 2021-03-09 | 71 |
| 2021-03-10 | 71 |
| 2021-03-11 | 78 |
| 2021-03-12 | 48 |
| 2021-03-13 | 24 |
| 2021-03-14 | 20 |
| 2021-03-15 | 36 |
| 2021-03-16 | 90 |
| 2021-03-17 | 79 |
| 2021-03-18 | 87 |
| 2021-03-19 | 40 |
| 2021-03-20 | 30 |
| 2021-03-21 | 37 |
| 2021-03-22 | 83 |
| 2021-03-23 | 83 |
| 2021-03-24 | 58 |
| 2021-03-25 | 65 |
| 2021-03-26 | 77 |
| 2021-03-27 | 20 |
| 2021-03-28 | 23 |
| 2021-03-29 | 91 |
| 2021-03-30 | 82 |
| 2021-03-31 | 65 |
| 2021-04-01 | 33 |
| 2021-04-02 | 17 |
| 2021-04-03 | 23 |
| 2021-04-04 | 23 |
| 2021-04-05 | 68 |
| 2021-04-06 | 76 |
| 2021-04-07 | 63 |
| 2021-04-08 | 71 |
| 2021-04-09 | 71 |
| 2021-04-10 | 30 |
| 2021-04-11 | 31 |
| 2021-04-12 | 82 |
| 2021-04-13 | 78 |
| 2021-04-14 | 66 |
| 2021-04-15 | 83 |
| 2021-04-16 | 62 |
| 2021-04-17 | 26 |
| 2021-04-18 | 36 |
| 2021-04-19 | 79 |
| 2021-04-20 | 83 |
| 2021-04-21 | 76 |
| 2021-04-22 | 65 |
| 2021-04-23 | 68 |
| 2021-04-24 | 25 |
| 2021-04-25 | 17 |
| 2021-04-26 | 79 |
| 2021-04-27 | 76 |
| 2021-04-28 | 57 |
| 2021-04-29 | 61 |
| 2021-04-30 | 64 |
| 2021-05-01 | 23 |
| 2021-05-02 | 26 |
| 2021-05-03 | 95 |
| 2021-05-04 | 68 |
| 2021-05-05 | 63 |
| 2021-05-06 | 54 |
| 2021-05-07 | 52 |
| 2021-05-08 | 26 |
| 2021-05-09 | 9 |
| 2021-05-10 | 44 |
| 2021-05-11 | 80 |
| 2021-05-12 | 88 |
| 2021-05-13 | 63 |
| 2021-05-14 | 71 |
| 2021-05-15 | 13 |
| 2021-05-16 | 10 |
| 2021-05-17 | 71 |
| 2021-05-18 | 98 |
| 2021-05-19 | 68 |
| 2021-05-20 | 57 |
| 2021-05-21 | 46 |
| 2021-05-22 | 31 |
| 2021-05-23 | 14 |
| 2021-05-24 | 51 |
| 2021-05-25 | 62 |
| 2021-05-26 | 45 |
| 2021-05-27 | 33 |
| 2021-05-28 | 35 |
| 2021-05-29 | 13 |
| 2021-05-30 | 7 |
| 2021-05-31 | 78 |
| 2021-06-01 | 56 |
| 2021-06-02 | 39 |
| 2021-06-03 | 34 |
| 2021-06-04 | 35 |
| 2021-06-05 | 15 |
| 2021-06-06 | 16 |
| 2021-06-07 | 53 |
| 2021-06-08 | 32 |
| 2021-06-09 | 41 |
| 2021-06-10 | 31 |
| 2021-06-11 | 30 |
| 2021-06-12 | 14 |
| 2021-06-13 | 9 |
| 2021-06-14 | 50 |
| 2021-06-15 | 57 |
| 2021-06-16 | 35 |
| 2021-06-17 | 37 |
| 2021-06-18 | 34 |
| 2021-06-19 | 17 |
| 2021-06-20 | 11 |
| 2021-06-21 | 48 |
| 2021-06-22 | 57 |
| 2021-06-23 | 37 |
| 2021-06-24 | 43 |
| 2021-06-25 | 32 |
| 2021-06-26 | 7 |
| 2021-06-27 | 6 |
| 2021-06-28 | 45 |
| 2021-06-29 | 46 |
| 2021-06-30 | 33 |
| 2021-07-01 | 58 |
| 2021-07-02 | 39 |
| 2021-07-03 | 48 |
| 2021-07-04 | 10 |
| 2021-07-05 | 84 |
| 2021-07-06 | 59 |
| 2021-07-07 | 77 |
| 2021-07-08 | 75 |
| 2021-07-09 | 79 |
| 2021-07-10 | 25 |
| 2021-07-11 | 15 |
| 2021-07-12 | 111 |
| 2021-07-13 | 90 |
| 2021-07-14 | 96 |
| 2021-07-15 | 83 |
| 2021-07-16 | 87 |
| 2021-07-17 | 18 |
| 2021-07-18 | 25 |
| 2021-07-19 | 156 |
| 2021-07-20 | 163 |
| 2021-07-21 | 176 |
| 2021-07-22 | 232 |
| 2021-07-23 | 173 |
| 2021-07-24 | 61 |
| 2021-07-25 | 23 |
| 2021-07-26 | 166 |
| 2021-07-27 | 201 |
| 2021-07-28 | 218 |
| 2021-07-29 | 236 |
| 2021-07-30 | 221 |
| 2021-07-31 | 46 |
| 2021-08-01 | 51 |
| 2021-08-02 | 193 |
| 2021-08-03 | 214 |
| 2021-08-04 | 194 |
| 2021-08-05 | 209 |
| 2021-08-06 | 184 |
| 2021-08-07 | 50 |
| 2021-08-08 | 49 |
| 2021-08-09 | 242 |
| 2021-08-10 | 331 |
| 2021-08-11 | 219 |
| 2021-08-12 | 264 |
| 2021-08-13 | 226 |
| 2021-08-14 | 72 |
| 2021-08-15 | 48 |
| 2021-08-16 | 299 |
| 2021-08-17 | 222 |
| 2021-08-18 | 209 |
| 2021-08-19 | 188 |
| 2021-08-20 | 162 |
| 2021-08-21 | 49 |
| 2021-08-22 | 55 |
| 2021-08-23 | 251 |
| 2021-08-24 | 242 |
| 2021-08-25 | 172 |
| 2021-08-26 | 165 |
| 2021-08-27 | 172 |
| 2021-08-28 | 64 |
| 2021-08-29 | 29 |
| 2021-08-30 | 165 |
| 2021-08-31 | 142 |
| 2021-09-01 | 115 |
| 2021-09-02 | 138 |
| 2021-09-03 | 93 |
| 2021-09-04 | 31 |
| 2021-09-05 | 18 |
| 2021-09-06 | 114 |
| 2021-09-07 | 103 |
| 2021-09-08 | 101 |
| 2021-09-09 | 114 |
| 2021-09-10 | 88 |
| 2021-09-11 | 21 |
| 2021-09-12 | 21 |
| 2021-09-13 | 93 |
| 2021-09-14 | 108 |
| 2021-09-15 | 55 |
| 2021-09-16 | 37 |
| 2021-09-17 | 77 |
| 2021-09-18 | 20 |
| 2021-09-19 | 17 |
| 2021-09-20 | 115 |
| 2021-09-21 | 106 |
| 2021-09-22 | 69 |
| 2021-09-23 | 100 |
| 2021-09-24 | 78 |
| 2021-09-25 | 18 |
| 2021-09-26 | 26 |
| 2021-09-27 | 108 |
| 2021-09-28 | 75 |
| 2021-09-29 | 74 |
| 2021-09-30 | 80 |
| 2021-10-01 | 97 |
| 2021-10-02 | 18 |
| 2021-10-03 | 17 |
| 2021-10-04 | 148 |
| 2021-10-05 | 145 |
| 2021-10-06 | 94 |
| 2021-10-07 | 86 |
| 2021-10-08 | 70 |
| 2021-10-09 | 20 |
| 2021-10-10 | 21 |
| 2021-10-11 | 114 |
| 2021-10-12 | 129 |
| 2021-10-13 | 102 |
| 2021-10-14 | 82 |
| 2021-10-15 | 66 |
| 2021-10-16 | 13 |
| 2021-10-17 | 10 |
| 2021-10-18 | 94 |
| 2021-10-19 | 72 |
| 2021-10-20 | 61 |
| 2021-10-21 | 91 |
| 2021-10-22 | 73 |
| 2021-10-23 | 28 |
| 2021-10-24 | 12 |
| 2021-10-25 | 110 |
| 2021-10-26 | 80 |
| 2021-10-27 | 74 |
| 2021-10-28 | 67 |
| 2021-10-29 | 81 |
| 2021-10-30 | 8 |
| 2021-10-31 | 12 |
| 2021-11-01 | 55 |
| 2021-11-02 | 36 |
| 2021-11-03 | 79 |
| 2021-11-04 | 76 |
| 2021-11-05 | 55 |
| 2021-11-06 | 7 |
| 2021-11-07 | 12 |
| 2021-11-08 | 90 |
| 2021-11-09 | 58 |
| 2021-11-10 | 66 |
| 2021-11-11 | 83 |
| 2021-11-12 | 83 |
| 2021-11-13 | 19 |
| 2021-11-14 | 15 |
| 2021-11-15 | 25 |
| 2021-11-16 | 108 |
| 2021-11-17 | 90 |
| 2021-11-18 | 82 |
| 2021-11-19 | 78 |
| 2021-11-20 | 21 |
| 2021-11-21 | 27 |
| 2021-11-22 | 128 |
| 2021-11-23 | 94 |
| 2021-11-24 | 105 |
| 2021-11-25 | 56 |
| 2021-11-26 | 63 |
| 2021-11-27 | 15 |
| 2021-11-28 | 15 |
| 2021-11-29 | 102 |
| 2021-11-30 | 90 |
| 2021-12-01 | 62 |
| 2021-12-02 | 73 |
| 2021-12-03 | 69 |
| 2021-12-04 | 22 |
| 2021-12-05 | 20 |
| 2021-12-06 | 84 |
| 2021-12-07 | 90 |
| 2021-12-08 | 63 |
| 2021-12-09 | 97 |
| 2021-12-10 | 74 |
| 2021-12-11 | 17 |
Total acumulado de defunciones por dia a nivel estatal.
De la informacion anterior, se le da formato de fecha a la columna que registra las fechas de las defunciones, despues se genera una columna de unos que se llenara con la informacion y se hace la tabla agregando el numero de defunciones segun la fecha para obtenerlas por dia a nivel estatal:
datos_zac$FECHA_DEF <- as.Date(datos_zac$FECHA_DEF,format="%Y-%m-%d")
datos_zac$DEFUNCIONES <- rep(1,length(datos_zac$FECHA_DEF))
DEFUNCIONES <- aggregate(DEFUNCIONES~FECHA_DEF,data=datos_zac,sum)
DEFUNCIONES %>%
kbl() %>%
kable_styling("hover", full_width = F)
| FECHA_DEF | DEFUNCIONES |
|---|---|
| 2020-01-13 | 1 |
| 2020-01-14 | 1 |
| 2020-01-18 | 1 |
| 2020-01-20 | 1 |
| 2020-01-21 | 1 |
| 2020-02-01 | 2 |
| 2020-02-10 | 2 |
| 2020-02-12 | 1 |
| 2020-02-16 | 1 |
| 2020-02-17 | 1 |
| 2020-02-18 | 1 |
| 2020-02-19 | 2 |
| 2020-02-20 | 1 |
| 2020-02-21 | 1 |
| 2020-02-22 | 1 |
| 2020-02-24 | 2 |
| 2020-03-01 | 1 |
| 2020-03-03 | 1 |
| 2020-03-10 | 1 |
| 2020-03-11 | 1 |
| 2020-03-15 | 1 |
| 2020-03-18 | 1 |
| 2020-03-19 | 1 |
| 2020-03-24 | 1 |
| 2020-03-26 | 1 |
| 2020-03-28 | 2 |
| 2020-03-30 | 1 |
| 2020-03-31 | 2 |
| 2020-04-02 | 1 |
| 2020-04-03 | 1 |
| 2020-04-04 | 1 |
| 2020-04-07 | 1 |
| 2020-04-08 | 1 |
| 2020-04-09 | 1 |
| 2020-04-10 | 3 |
| 2020-04-14 | 1 |
| 2020-04-15 | 3 |
| 2020-04-16 | 1 |
| 2020-04-19 | 2 |
| 2020-04-20 | 1 |
| 2020-04-22 | 1 |
| 2020-04-23 | 1 |
| 2020-04-24 | 1 |
| 2020-04-25 | 1 |
| 2020-04-26 | 1 |
| 2020-04-27 | 2 |
| 2020-04-28 | 2 |
| 2020-04-29 | 1 |
| 2020-04-30 | 1 |
| 2020-05-01 | 1 |
| 2020-05-02 | 4 |
| 2020-05-03 | 4 |
| 2020-05-04 | 1 |
| 2020-05-05 | 1 |
| 2020-05-07 | 1 |
| 2020-05-08 | 3 |
| 2020-05-09 | 2 |
| 2020-05-10 | 2 |
| 2020-05-11 | 1 |
| 2020-05-12 | 3 |
| 2020-05-13 | 1 |
| 2020-05-14 | 2 |
| 2020-05-15 | 3 |
| 2020-05-17 | 2 |
| 2020-05-18 | 1 |
| 2020-05-19 | 5 |
| 2020-05-21 | 1 |
| 2020-05-22 | 2 |
| 2020-05-23 | 1 |
| 2020-05-24 | 2 |
| 2020-05-25 | 1 |
| 2020-05-26 | 1 |
| 2020-05-27 | 4 |
| 2020-05-28 | 2 |
| 2020-05-29 | 3 |
| 2020-05-30 | 2 |
| 2020-05-31 | 3 |
| 2020-06-01 | 2 |
| 2020-06-02 | 3 |
| 2020-06-03 | 3 |
| 2020-06-04 | 4 |
| 2020-06-05 | 3 |
| 2020-06-06 | 2 |
| 2020-06-07 | 3 |
| 2020-06-08 | 6 |
| 2020-06-09 | 3 |
| 2020-06-10 | 6 |
| 2020-06-11 | 2 |
| 2020-06-12 | 1 |
| 2020-06-14 | 7 |
| 2020-06-15 | 3 |
| 2020-06-16 | 6 |
| 2020-06-17 | 6 |
| 2020-06-18 | 9 |
| 2020-06-19 | 1 |
| 2020-06-20 | 2 |
| 2020-06-21 | 2 |
| 2020-06-22 | 2 |
| 2020-06-23 | 2 |
| 2020-06-24 | 3 |
| 2020-06-25 | 6 |
| 2020-06-26 | 6 |
| 2020-06-27 | 1 |
| 2020-06-28 | 4 |
| 2020-06-29 | 3 |
| 2020-06-30 | 4 |
| 2020-07-01 | 7 |
| 2020-07-02 | 8 |
| 2020-07-03 | 4 |
| 2020-07-04 | 3 |
| 2020-07-05 | 1 |
| 2020-07-06 | 5 |
| 2020-07-07 | 11 |
| 2020-07-08 | 7 |
| 2020-07-09 | 4 |
| 2020-07-10 | 7 |
| 2020-07-11 | 4 |
| 2020-07-12 | 7 |
| 2020-07-13 | 5 |
| 2020-07-14 | 8 |
| 2020-07-15 | 8 |
| 2020-07-16 | 7 |
| 2020-07-17 | 3 |
| 2020-07-18 | 11 |
| 2020-07-19 | 7 |
| 2020-07-20 | 7 |
| 2020-07-21 | 6 |
| 2020-07-22 | 3 |
| 2020-07-23 | 8 |
| 2020-07-24 | 10 |
| 2020-07-25 | 10 |
| 2020-07-26 | 15 |
| 2020-07-27 | 3 |
| 2020-07-28 | 8 |
| 2020-07-29 | 9 |
| 2020-07-30 | 10 |
| 2020-07-31 | 9 |
| 2020-08-01 | 15 |
| 2020-08-02 | 9 |
| 2020-08-03 | 12 |
| 2020-08-04 | 8 |
| 2020-08-05 | 11 |
| 2020-08-06 | 16 |
| 2020-08-07 | 10 |
| 2020-08-08 | 24 |
| 2020-08-09 | 15 |
| 2020-08-10 | 12 |
| 2020-08-11 | 9 |
| 2020-08-12 | 13 |
| 2020-08-13 | 10 |
| 2020-08-14 | 5 |
| 2020-08-15 | 10 |
| 2020-08-16 | 4 |
| 2020-08-17 | 14 |
| 2020-08-18 | 9 |
| 2020-08-19 | 7 |
| 2020-08-20 | 7 |
| 2020-08-21 | 7 |
| 2020-08-22 | 13 |
| 2020-08-23 | 13 |
| 2020-08-24 | 9 |
| 2020-08-25 | 8 |
| 2020-08-26 | 9 |
| 2020-08-27 | 11 |
| 2020-08-28 | 8 |
| 2020-08-29 | 14 |
| 2020-08-30 | 7 |
| 2020-08-31 | 12 |
| 2020-09-01 | 13 |
| 2020-09-02 | 10 |
| 2020-09-03 | 8 |
| 2020-09-04 | 12 |
| 2020-09-05 | 8 |
| 2020-09-06 | 10 |
| 2020-09-07 | 14 |
| 2020-09-08 | 9 |
| 2020-09-09 | 16 |
| 2020-09-10 | 5 |
| 2020-09-11 | 9 |
| 2020-09-12 | 7 |
| 2020-09-13 | 9 |
| 2020-09-14 | 4 |
| 2020-09-15 | 9 |
| 2020-09-16 | 9 |
| 2020-09-17 | 4 |
| 2020-09-18 | 8 |
| 2020-09-19 | 7 |
| 2020-09-20 | 10 |
| 2020-09-21 | 8 |
| 2020-09-22 | 9 |
| 2020-09-23 | 8 |
| 2020-09-24 | 7 |
| 2020-09-25 | 1 |
| 2020-09-26 | 10 |
| 2020-09-27 | 9 |
| 2020-09-28 | 12 |
| 2020-09-29 | 10 |
| 2020-09-30 | 10 |
| 2020-10-01 | 4 |
| 2020-10-02 | 7 |
| 2020-10-03 | 9 |
| 2020-10-04 | 9 |
| 2020-10-05 | 12 |
| 2020-10-06 | 7 |
| 2020-10-07 | 7 |
| 2020-10-08 | 1 |
| 2020-10-09 | 11 |
| 2020-10-10 | 8 |
| 2020-10-11 | 8 |
| 2020-10-12 | 8 |
| 2020-10-13 | 10 |
| 2020-10-14 | 10 |
| 2020-10-15 | 5 |
| 2020-10-16 | 14 |
| 2020-10-17 | 7 |
| 2020-10-18 | 7 |
| 2020-10-19 | 12 |
| 2020-10-20 | 7 |
| 2020-10-21 | 15 |
| 2020-10-22 | 10 |
| 2020-10-23 | 13 |
| 2020-10-24 | 14 |
| 2020-10-25 | 10 |
| 2020-10-26 | 14 |
| 2020-10-27 | 20 |
| 2020-10-28 | 11 |
| 2020-10-29 | 19 |
| 2020-10-30 | 12 |
| 2020-10-31 | 18 |
| 2020-11-01 | 14 |
| 2020-11-02 | 18 |
| 2020-11-03 | 21 |
| 2020-11-04 | 11 |
| 2020-11-05 | 18 |
| 2020-11-06 | 20 |
| 2020-11-07 | 16 |
| 2020-11-08 | 19 |
| 2020-11-09 | 16 |
| 2020-11-10 | 20 |
| 2020-11-11 | 20 |
| 2020-11-12 | 22 |
| 2020-11-13 | 18 |
| 2020-11-14 | 18 |
| 2020-11-15 | 14 |
| 2020-11-16 | 13 |
| 2020-11-17 | 20 |
| 2020-11-18 | 14 |
| 2020-11-19 | 12 |
| 2020-11-20 | 18 |
| 2020-11-21 | 18 |
| 2020-11-22 | 18 |
| 2020-11-23 | 29 |
| 2020-11-24 | 23 |
| 2020-11-25 | 17 |
| 2020-11-26 | 25 |
| 2020-11-27 | 11 |
| 2020-11-28 | 22 |
| 2020-11-29 | 27 |
| 2020-11-30 | 18 |
| 2020-12-01 | 23 |
| 2020-12-02 | 21 |
| 2020-12-03 | 26 |
| 2020-12-04 | 15 |
| 2020-12-05 | 22 |
| 2020-12-06 | 10 |
| 2020-12-07 | 23 |
| 2020-12-08 | 19 |
| 2020-12-09 | 16 |
| 2020-12-10 | 16 |
| 2020-12-11 | 13 |
| 2020-12-12 | 19 |
| 2020-12-13 | 12 |
| 2020-12-14 | 10 |
| 2020-12-15 | 15 |
| 2020-12-16 | 14 |
| 2020-12-17 | 21 |
| 2020-12-18 | 13 |
| 2020-12-19 | 14 |
| 2020-12-20 | 7 |
| 2020-12-21 | 18 |
| 2020-12-22 | 13 |
| 2020-12-23 | 10 |
| 2020-12-24 | 13 |
| 2020-12-25 | 15 |
| 2020-12-26 | 7 |
| 2020-12-27 | 15 |
| 2020-12-28 | 15 |
| 2020-12-29 | 12 |
| 2020-12-30 | 15 |
| 2020-12-31 | 11 |
| 2021-01-01 | 14 |
| 2021-01-02 | 15 |
| 2021-01-03 | 16 |
| 2021-01-04 | 21 |
| 2021-01-05 | 16 |
| 2021-01-06 | 19 |
| 2021-01-07 | 17 |
| 2021-01-08 | 15 |
| 2021-01-09 | 15 |
| 2021-01-10 | 10 |
| 2021-01-11 | 17 |
| 2021-01-12 | 10 |
| 2021-01-13 | 18 |
| 2021-01-14 | 10 |
| 2021-01-15 | 21 |
| 2021-01-16 | 11 |
| 2021-01-17 | 16 |
| 2021-01-18 | 19 |
| 2021-01-19 | 13 |
| 2021-01-20 | 14 |
| 2021-01-21 | 12 |
| 2021-01-22 | 17 |
| 2021-01-23 | 12 |
| 2021-01-24 | 20 |
| 2021-01-25 | 18 |
| 2021-01-26 | 15 |
| 2021-01-27 | 19 |
| 2021-01-28 | 13 |
| 2021-01-29 | 15 |
| 2021-01-30 | 14 |
| 2021-01-31 | 12 |
| 2021-02-01 | 13 |
| 2021-02-02 | 26 |
| 2021-02-03 | 21 |
| 2021-02-04 | 15 |
| 2021-02-05 | 14 |
| 2021-02-06 | 20 |
| 2021-02-07 | 15 |
| 2021-02-08 | 19 |
| 2021-02-09 | 11 |
| 2021-02-10 | 13 |
| 2021-02-11 | 12 |
| 2021-02-12 | 12 |
| 2021-02-13 | 7 |
| 2021-02-14 | 13 |
| 2021-02-15 | 14 |
| 2021-02-16 | 7 |
| 2021-02-17 | 8 |
| 2021-02-18 | 9 |
| 2021-02-19 | 11 |
| 2021-02-20 | 10 |
| 2021-02-21 | 10 |
| 2021-02-22 | 9 |
| 2021-02-23 | 9 |
| 2021-02-24 | 7 |
| 2021-02-25 | 8 |
| 2021-02-26 | 7 |
| 2021-02-27 | 5 |
| 2021-02-28 | 6 |
| 2021-03-01 | 10 |
| 2021-03-02 | 9 |
| 2021-03-03 | 11 |
| 2021-03-04 | 9 |
| 2021-03-05 | 11 |
| 2021-03-06 | 7 |
| 2021-03-07 | 3 |
| 2021-03-08 | 8 |
| 2021-03-09 | 2 |
| 2021-03-10 | 9 |
| 2021-03-11 | 5 |
| 2021-03-12 | 6 |
| 2021-03-13 | 4 |
| 2021-03-14 | 5 |
| 2021-03-15 | 7 |
| 2021-03-16 | 9 |
| 2021-03-17 | 2 |
| 2021-03-18 | 3 |
| 2021-03-19 | 6 |
| 2021-03-20 | 12 |
| 2021-03-21 | 7 |
| 2021-03-22 | 4 |
| 2021-03-23 | 3 |
| 2021-03-24 | 4 |
| 2021-03-25 | 1 |
| 2021-03-26 | 6 |
| 2021-03-27 | 4 |
| 2021-03-28 | 10 |
| 2021-03-30 | 3 |
| 2021-03-31 | 8 |
| 2021-04-01 | 3 |
| 2021-04-02 | 3 |
| 2021-04-03 | 4 |
| 2021-04-04 | 4 |
| 2021-04-05 | 3 |
| 2021-04-06 | 5 |
| 2021-04-08 | 5 |
| 2021-04-09 | 2 |
| 2021-04-10 | 9 |
| 2021-04-11 | 4 |
| 2021-04-12 | 1 |
| 2021-04-13 | 2 |
| 2021-04-14 | 2 |
| 2021-04-15 | 3 |
| 2021-04-16 | 3 |
| 2021-04-17 | 2 |
| 2021-04-18 | 9 |
| 2021-04-19 | 4 |
| 2021-04-22 | 5 |
| 2021-04-23 | 4 |
| 2021-04-24 | 6 |
| 2021-04-25 | 3 |
| 2021-04-26 | 4 |
| 2021-04-27 | 5 |
| 2021-04-28 | 1 |
| 2021-04-29 | 3 |
| 2021-04-30 | 3 |
| 2021-05-01 | 4 |
| 2021-05-02 | 1 |
| 2021-05-03 | 1 |
| 2021-05-04 | 2 |
| 2021-05-05 | 4 |
| 2021-05-06 | 6 |
| 2021-05-07 | 2 |
| 2021-05-08 | 2 |
| 2021-05-09 | 2 |
| 2021-05-10 | 2 |
| 2021-05-11 | 2 |
| 2021-05-12 | 2 |
| 2021-05-13 | 2 |
| 2021-05-14 | 2 |
| 2021-05-15 | 1 |
| 2021-05-16 | 5 |
| 2021-05-17 | 2 |
| 2021-05-19 | 3 |
| 2021-05-21 | 3 |
| 2021-05-22 | 1 |
| 2021-05-23 | 2 |
| 2021-05-25 | 6 |
| 2021-05-27 | 2 |
| 2021-05-28 | 1 |
| 2021-05-30 | 3 |
| 2021-05-31 | 4 |
| 2021-06-01 | 4 |
| 2021-06-02 | 3 |
| 2021-06-04 | 3 |
| 2021-06-05 | 2 |
| 2021-06-07 | 5 |
| 2021-06-08 | 2 |
| 2021-06-10 | 1 |
| 2021-06-14 | 1 |
| 2021-06-15 | 2 |
| 2021-06-16 | 1 |
| 2021-06-17 | 2 |
| 2021-06-20 | 1 |
| 2021-06-22 | 2 |
| 2021-06-23 | 1 |
| 2021-06-25 | 1 |
| 2021-06-28 | 1 |
| 2021-06-30 | 4 |
| 2021-07-01 | 1 |
| 2021-07-04 | 1 |
| 2021-07-05 | 1 |
| 2021-07-06 | 1 |
| 2021-07-07 | 1 |
| 2021-07-08 | 1 |
| 2021-07-09 | 1 |
| 2021-07-12 | 2 |
| 2021-07-13 | 1 |
| 2021-07-14 | 1 |
| 2021-07-15 | 2 |
| 2021-07-16 | 1 |
| 2021-07-17 | 1 |
| 2021-07-18 | 2 |
| 2021-07-19 | 1 |
| 2021-07-20 | 1 |
| 2021-07-22 | 3 |
| 2021-07-23 | 4 |
| 2021-07-24 | 1 |
| 2021-07-25 | 2 |
| 2021-07-26 | 4 |
| 2021-07-27 | 5 |
| 2021-07-28 | 2 |
| 2021-07-29 | 8 |
| 2021-07-30 | 3 |
| 2021-07-31 | 7 |
| 2021-08-01 | 1 |
| 2021-08-02 | 11 |
| 2021-08-03 | 4 |
| 2021-08-04 | 6 |
| 2021-08-05 | 5 |
| 2021-08-06 | 6 |
| 2021-08-07 | 6 |
| 2021-08-08 | 6 |
| 2021-08-09 | 10 |
| 2021-08-10 | 3 |
| 2021-08-11 | 4 |
| 2021-08-12 | 10 |
| 2021-08-13 | 5 |
| 2021-08-14 | 5 |
| 2021-08-15 | 6 |
| 2021-08-16 | 3 |
| 2021-08-17 | 9 |
| 2021-08-18 | 8 |
| 2021-08-19 | 12 |
| 2021-08-20 | 6 |
| 2021-08-21 | 9 |
| 2021-08-22 | 12 |
| 2021-08-23 | 6 |
| 2021-08-24 | 7 |
| 2021-08-25 | 10 |
| 2021-08-26 | 7 |
| 2021-08-27 | 3 |
| 2021-08-28 | 10 |
| 2021-08-29 | 7 |
| 2021-08-30 | 13 |
| 2021-08-31 | 10 |
| 2021-09-01 | 9 |
| 2021-09-02 | 9 |
| 2021-09-03 | 7 |
| 2021-09-04 | 10 |
| 2021-09-05 | 13 |
| 2021-09-06 | 5 |
| 2021-09-07 | 7 |
| 2021-09-08 | 8 |
| 2021-09-09 | 5 |
| 2021-09-10 | 6 |
| 2021-09-11 | 10 |
| 2021-09-12 | 5 |
| 2021-09-13 | 5 |
| 2021-09-14 | 9 |
| 2021-09-15 | 7 |
| 2021-09-16 | 6 |
| 2021-09-17 | 5 |
| 2021-09-18 | 3 |
| 2021-09-19 | 6 |
| 2021-09-20 | 6 |
| 2021-09-21 | 9 |
| 2021-09-22 | 5 |
| 2021-09-23 | 5 |
| 2021-09-24 | 5 |
| 2021-09-25 | 6 |
| 2021-09-26 | 8 |
| 2021-09-27 | 4 |
| 2021-09-28 | 2 |
| 2021-09-29 | 4 |
| 2021-09-30 | 6 |
| 2021-10-01 | 4 |
| 2021-10-02 | 4 |
| 2021-10-03 | 4 |
| 2021-10-04 | 6 |
| 2021-10-05 | 3 |
| 2021-10-06 | 5 |
| 2021-10-07 | 6 |
| 2021-10-08 | 1 |
| 2021-10-09 | 5 |
| 2021-10-10 | 6 |
| 2021-10-11 | 7 |
| 2021-10-12 | 3 |
| 2021-10-13 | 1 |
| 2021-10-14 | 5 |
| 2021-10-15 | 1 |
| 2021-10-16 | 3 |
| 2021-10-17 | 2 |
| 2021-10-18 | 3 |
| 2021-10-19 | 4 |
| 2021-10-20 | 5 |
| 2021-10-21 | 2 |
| 2021-10-22 | 3 |
| 2021-10-23 | 6 |
| 2021-10-24 | 2 |
| 2021-10-25 | 4 |
| 2021-10-26 | 2 |
| 2021-10-27 | 3 |
| 2021-10-28 | 5 |
| 2021-10-29 | 4 |
| 2021-10-30 | 1 |
| 2021-11-01 | 8 |
| 2021-11-02 | 3 |
| 2021-11-04 | 1 |
| 2021-11-05 | 1 |
| 2021-11-06 | 3 |
| 2021-11-07 | 4 |
| 2021-11-08 | 4 |
| 2021-11-09 | 3 |
| 2021-11-10 | 1 |
| 2021-11-11 | 2 |
| 2021-11-12 | 1 |
| 2021-11-13 | 3 |
| 2021-11-14 | 2 |
| 2021-11-15 | 1 |
| 2021-11-16 | 1 |
| 2021-11-17 | 3 |
| 2021-11-19 | 1 |
| 2021-11-20 | 5 |
| 2021-11-21 | 3 |
| 2021-11-23 | 1 |
| 2021-11-24 | 3 |
| 2021-11-27 | 5 |
| 2021-11-28 | 1 |
| 2021-11-29 | 1 |
| 2021-11-30 | 2 |
| 2021-12-02 | 3 |
| 2021-12-03 | 2 |
| 2021-12-04 | 2 |
| 2021-12-06 | 2 |
| 2021-12-07 | 1 |
| 2021-12-08 | 2 |
% de mujeres, a nivel municipal, que representan un caso positivo.
Con los datos anteriores se agrega la columna de sexo a la tabla municipal desde la base principal, despues se identifican a las mujeres con “1” y a los hombres con “0” para posteriormente sumar la columna de sexo con la que contiene los casos confirmados (que estan representados con “1”), asi en la columna MUJERES_POSI se identifican a las mujeres contagiadas con los renglones que sumaron “2”.
Para terminar se elabora un data frame que agregue a las mujeres contagiadas segun el municipio de residencia y se genera la tabla:
tabla_muni$SEXO <- datos_zac$SEXO
tabla_muni$SEXO <- ifelse(tabla_muni$SEXO == 1, 1, 0)
tabla_muni$MUJERES_POSI <- tabla_muni$CLASIFICACION_FINAL+tabla_muni$SEXO
tabla_muni$MUJERES_POSI <-ifelse(tabla_muni$MUJERES_POSI == 2, 1, 0)
mujeres_posi <- as.data.frame(aggregate(cbind(MUJERES_POSI, CLASIFICACION_FINAL)~MUNICIPIO, data=tabla_muni, sum))
mujeres_posi$PORC_MUJ <- round((mujeres_posi$MUJERES_POSI/mujeres_posi$CLASIFICACION_FINAL)*100, 2)
mujeres_posi %>%
kbl() %>%
kable_styling("hover", full_width = F)
| MUNICIPIO | MUJERES_POSI | CLASIFICACION_FINAL | PORC_MUJ |
|---|---|---|---|
| APOZOL | 25 | 42 | 59.52 |
| APULCO | 20 | 32 | 62.50 |
| ATOLINGA | 32 | 53 | 60.38 |
| BENITO JUÁREZ | 24 | 47 | 51.06 |
| CALERA | 418 | 757 | 55.22 |
| CAÑITAS DE FELIPE PESCADOR | 41 | 71 | 57.75 |
| CHALCHIHUITES | 30 | 64 | 46.88 |
| CONCEPCIÓN DEL ORO | 270 | 507 | 53.25 |
| CUAUHTÉMOC | 52 | 90 | 57.78 |
| EL PLATEADO DE JOAQUÍN AMARO | 6 | 11 | 54.55 |
| EL SALVADOR | 15 | 28 | 53.57 |
| FRESNILLO | 3789 | 7373 | 51.39 |
| GENARO CODINA | 52 | 83 | 62.65 |
| GENERAL ENRIQUE ESTRADA | 43 | 86 | 50.00 |
| GENERAL FRANCISCO R. MURGUÍA | 101 | 197 | 51.27 |
| GENERAL PÁNFILO NATERA | 116 | 231 | 50.22 |
| GUADALUPE | 4742 | 9237 | 51.34 |
| HUANUSCO | 21 | 54 | 38.89 |
| JALPA | 241 | 454 | 53.08 |
| JEREZ | 739 | 1424 | 51.90 |
| JIMÉNEZ DEL TEUL | 13 | 27 | 48.15 |
| JUAN ALDAMA | 111 | 193 | 57.51 |
| JUCHIPILA | 73 | 130 | 56.15 |
| LORETO | 284 | 538 | 52.79 |
| LUIS MOYA | 52 | 94 | 55.32 |
| MAZAPIL | 161 | 292 | 55.14 |
| MELCHOR OCAMPO | 10 | 13 | 76.92 |
| MEZQUITAL DEL ORO | 10 | 16 | 62.50 |
| MIGUEL AUZA | 87 | 156 | 55.77 |
| MOMAX | 61 | 110 | 55.45 |
| MONTE ESCOBEDO | 130 | 237 | 54.85 |
| MORELOS | 197 | 374 | 52.67 |
| MOYAHUA DE ESTRADA | 12 | 21 | 57.14 |
| NO ESPECIFICADO | 1 | 1 | 100.00 |
| NOCHISTLÁN DE MEJÍA | 774 | 1313 | 58.95 |
| NORIA DE ÁNGELES | 67 | 112 | 59.82 |
| OJOCALIENTE | 297 | 581 | 51.12 |
| PÁNUCO | 98 | 172 | 56.98 |
| PINOS | 301 | 549 | 54.83 |
| RÍO GRANDE | 417 | 768 | 54.30 |
| SAIN ALTO | 52 | 130 | 40.00 |
| SANTA MARÍA DE LA PAZ | 25 | 41 | 60.98 |
| SOMBRERETE | 931 | 1677 | 55.52 |
| SUSTICACÁN | 10 | 18 | 55.56 |
| TABASCO | 165 | 276 | 59.78 |
| TEPECHITLÁN | 102 | 193 | 52.85 |
| TEPETONGO | 56 | 97 | 57.73 |
| TEÚL DE GONZÁLEZ ORTEGA | 104 | 183 | 56.83 |
| TLALTENANGO DE SÁNCHEZ ROMÁN | 505 | 946 | 53.38 |
| TRANCOSO | 160 | 309 | 51.78 |
| TRINIDAD GARCÍA DE LA CADENA | 22 | 43 | 51.16 |
| VALPARAÍSO | 127 | 240 | 52.92 |
| VETAGRANDE | 73 | 141 | 51.77 |
| VILLA DE COS | 244 | 446 | 54.71 |
| VILLA GARCÍA | 62 | 110 | 56.36 |
| VILLA GONZÁLEZ ORTEGA | 90 | 151 | 59.60 |
| VILLA HIDALGO | 63 | 127 | 49.61 |
| VILLANUEVA | 312 | 537 | 58.10 |
| ZACATECAS | 5099 | 10135 | 50.31 |
Grafico de barras de los 10 municipios con mayor % de defunciones
Se genera una tabla con el porcentaje de fallecidos, y se ordena de menor a mayor, despues se corta la tabla a los ultimos datos para obtener los municipios con mayor porcentaje.
tabla_def <- prop_def[order(prop_def$PORCENTAJE),]
tabla_def <- prop_def[50:59,-c(2,3)]
tabla_def <- tabla_def[order(tabla_def$PORCENTAJE),]
graf_def<-plot_ly(data=tabla_def, x=~MUNICIPIO, y=~PORCENTAJE, type="bar", color = rainbow(10), colors=NULL)
graf_def<- graf_def %>% layout (showlegend=FALSE)
graf_def
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
Grafico de barras de los 10 municipios con mayor numero de casos positivos detectados, divido por hombres y por mujeres.
Con los datos a nivel municipal se filtran por municipio y sexo con aggregate y se genera una nueva tabla para hacer el arreglo por hombres y mujeres:
tabla_muni2 <- tabla_muni
tabla_muni2$SEXO <- datos_zac$SEXO
tabla_muni2 <- aggregate(CLASIFICACION_FINAL ~ MUNICIPIO+SEXO, tabla_muni2, sum)
total_posi <- prop_def[,1:2]
tabla_muni3 <- left_join(tabla_muni2, total_posi, by = c("MUNICIPIO" = "MUNICIPIO"))
tabla_muni3 <- tabla_muni3 %>% arrange(desc(tabla_muni3$CLASIFICACION_FINAL.y), MUNICIPIO, SEXO, .by_group = TRUE)
tabla_muni3$SEXO <- ifelse(tabla_muni3$SEXO == 1, "MUJERES", "HOMBRES")
Se genera la grafica con ggplot:
graf_mun_sexo <- ggplot(data = tabla_muni3[1:20,], aes(x=reorder(MUNICIPIO,-CLASIFICACION_FINAL.x),y= CLASIFICACION_FINAL.x, fill=SEXO))+
geom_bar(stat="identity", position=position_dodge())+
theme_get() +
theme(axis.text.x=element_text(size=rel(.75), angle=90))+
labs(title = "Municipios con más casos positivos: hombres y mujeres",
x="MUNICIPIOS", y="FRECUENCIA")+
scale_fill_manual(values=brewer.pal(n = 3, name = "Accent"))
graf_mun_sexo_inter <- ggplotly(graf_mun_sexo)
graf_mun_sexo_inter
Grafico de lineas que representa el numero acumulado de defunciones a nivel estatal por dia. Al desplazar el cursor sobre la linea, se debe de mostrar la cantidad representada en la linea.
don <- xts(x=DEFUNCIONES ,order.by=DEFUNCIONES$FECHA_DEF)
dygraph(don) %>%
dyOptions(labelsUTC = TRUE, fillGraph=TRUE, fillAlpha=0.1, drawGrid = FALSE, colors="#D8AE5A") %>%
dyRangeSelector() %>%
dyCrosshair(direction = "vertical") %>%
dyHighlight(highlightCircleSize = 5, highlightSeriesBackgroundAlpha = 0.2, hideOnMouseOut = FALSE) %>%
dyRoller(rollPeriod = 1)
Mapa que muestre la distribucion espacial, por municipio, del % de defunciones. Utilizar el corte por cuantiles. Al situar el cursor sobre el municipio, se debe de desplegar el % de defunciones y el total de casos de defunciones del correspondiente.
Se cargan los datos del mapa generado en qgiz
mapa_zaca <- readOGR("C:\\Users\\richa\\OneDrive - CIDE\\1er Semestre-DESKTOP-RPQUJJA\\Manejo de bases de datos\\Examen", layer="mapa_zaca")
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\richa\OneDrive - CIDE\1er Semestre-DESKTOP-RPQUJJA\Manejo de bases de datos\Examen", layer: "mapa_zaca"
## with 58 features
## It has 4 fields
Se agregan los datos del porcentaje de defunciones al objeto generado con la informacion del mapa:
prop_def2 <- prop_def[-c(34),]
mapa_zaca@data$Prop_def <- prop_def2$PORCENTAJE
mapa_zaca@data$Defunciones <- prop_def2$DEFUNCIONES
Se genera el mapa interactivo usando la paqueteria de leaflet:
textoss <- paste(
"Municipio : ",mapa_zaca$NOMGEO ,"<br/>",
"% Defunciones: ", mapa_zaca$Prop_def,"<br/>",
"Defunciones totales: ", mapa_zaca$Defunciones) %>% lapply(htmltools::HTML)
cortess <- c(0,2.14,15.1,28.0,40.9,53.9,Inf)
colores <- colorBin( palette="Blues", domain=mapa_zaca$Prop_def, na.color="transparent", bins=cortess)
leaflet(data=mapa_zaca) %>%
addTiles() %>%
addPolygons(label = textoss,
fillColor = colores(mapa_zaca$Prop_def),
fillOpacity = 0.9,color="#EFC000FF",weight=2) %>%
leaflet::addLegend("bottomright", pal = colores, values = ~Prop_def,
title = "Defunciones totales",
#labFormat = labelFormat(prefix = "$"),
opacity = 1 )