Final_Term_Emilio_Matzarev

Utilizando la información brindada por la Secretaria de Salud Federal sobre los casos de COVID-19 detectados en la República Mexicana, y considerando solamente los casos positivos (verificar que la información que se obtenga de la base de datos sea igual a la reportada diariamente por dicha secretaría), obtener lo siguiente.

ESTADO: GUERRERO

Estado de Guerrero

Cargamos de forma elegante los paquetes que no tiene R de base y que serán necesarios en el trancurso de a actividad.

knitr::opts_chunk$set(
    echo = TRUE,
    message = TRUE,
    warning = FALSE
)
list.of.packages <- c("dygraphs", "xts", "tidyverse", "lubridate", "dplyr", "sf", "ggplot2", "readxl", "stringr", "RColorBrewer", "scales", "leaflet", "htmltools","plotly","rgdal","kableExtra","ggsci","rmdformats")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)

lapply(list.of.packages, require, character.only = TRUE)
## [[1]]
## [1] TRUE
## 
## [[2]]
## [1] TRUE
## 
## [[3]]
## [1] TRUE
## 
## [[4]]
## [1] TRUE
## 
## [[5]]
## [1] TRUE
## 
## [[6]]
## [1] TRUE
## 
## [[7]]
## [1] TRUE
## 
## [[8]]
## [1] TRUE
## 
## [[9]]
## [1] TRUE
## 
## [[10]]
## [1] TRUE
## 
## [[11]]
## [1] TRUE
## 
## [[12]]
## [1] TRUE
## 
## [[13]]
## [1] TRUE
## 
## [[14]]
## [1] TRUE
## 
## [[15]]
## [1] TRUE
## 
## [[16]]
## [1] TRUE
## 
## [[17]]
## [1] TRUE
## 
## [[18]]
## [1] TRUE

EJERCICIO 1

La base de datos y su catálogo se encuentran disponibles en https://www.gob.mx/salud/documentos/datos-abiertos-152127

Covid <- read.csv("C:\\Users\\permi\\Desktop\\CIDE\\Primer semestre\\R\\COVID\\211213COVID19MEXICO.csv")

1. Eligiendo un estado de la república de residencia del paciente que tenga más de 20 municipios, obtener (tablas):

Filtramos la base de datos por la clave del estado de Guerrero (12), después por los casos positivos (3) y agregamos una columa extra con unos para futuros conteos.

covid_g<-which(Covid$ENTIDAD_RES == "12")
Covid_Guerrero<-Covid[covid_g,]

casos_positivos<-which(Covid_Guerrero$CLASIFICACION_FINAL == 3)
Covid_G_P<-Covid_Guerrero[casos_positivos,]

nombres_mun<-read_xlsx("C:\\Users\\permi\\Desktop\\CIDE\\Primer semestre\\R\\COVID\\201128 Catalogos.xlsx", sheet = "Catálogo MUNICIPIOS")

G_mun<-which(nombres_mun$CLAVE_ENTIDAD =="12")

municipios_G<-nombres_mun[G_mun,-3]

Covid_Guerrero_Positivos<-merge(Covid_G_P, municipios_G, by.x ="MUNICIPIO_RES", by.y ="CLAVE_MUNICIPIO")

Covid_Guerrero_Positivos$unos<-1

- 1. (5%) % de defunciones por municipio (total de defunciones / total de casos positivos).

Filtramos la base de datos por el total de defunciones en cada municipio y también por el total de casos positivos en cada municipio. Calculamos el porcentaje de defunciones por municipio por medio de una división.

Defunciones<-which(Covid_Guerrero_Positivos$FECHA_DEF=="9999-99-99")

Def_X_Mun<-aggregate(unos~MUNICIPIO,data=Covid_Guerrero_Positivos[-Defunciones,],FUN=sum)

P_x_Mun<-aggregate(unos~MUNICIPIO, data=Covid_Guerrero_Positivos,FUN=sum)

Def_Pos_Mun<-merge(Def_X_Mun ,P_x_Mun, by="MUNICIPIO")

Porcentaje<-data.frame(Municipio = Def_Pos_Mun$MUNICIPIO, porcentaje =round(Def_Pos_Mun$unos.x/Def_Pos_Mun$unos.y*100,2))

Porcentaje<-merge(x=Def_Pos_Mun , y=Porcentaje , by.x="MUNICIPIO", by.y="Municipio")


Porcentaje %>% kbl(caption= "PORCENTAJDE DEFUNCIONES POR MUNICIPIO", col.names = c("Municipio","Total de defunciones","Total de casos positivos","Porcentaje")) %>% kable_classic(full_width = F, html_font = "Cambria") %>% kable_paper(full_width = F) %>% column_spec(column = 4 , color = "White" ,bold = TRUE ,background = spec_color(Porcentaje$porcentaje, end = 1, option = "C", direction = -1 )) %>% scroll_box(width = "400px", height = "300px")
PORCENTAJDE DEFUNCIONES POR MUNICIPIO
Municipio Total de defunciones Total de casos positivos Porcentaje
ACAPULCO DE JUÁREZ 2669 29446 9.06
ACATEPEC 3 42 7.14
AHUACUOTZINGO 13 253 5.14
AJUCHITLÁN DEL PROGRESO 57 317 17.98
ALCOZAUCA DE GUERRERO 12 108 11.11
ALPOYECA 17 101 16.83
APAXTLA 7 32 21.88
ARCELIA 42 382 10.99
ATENANGO DEL RÍO 6 31 19.35
ATLAMAJALCINGO DEL MONTE 5 13 38.46
ATLIXTAC 4 51 7.84
ATOYAC DE ÁLVAREZ 68 935 7.27
AYUTLA DE LOS LIBRES 57 887 6.43
AZOYÚ 17 238 7.14
BENITO JUÁREZ 12 309 3.88
BUENAVISTA DE CUÉLLAR 15 144 10.42
CHILAPA DE ÁLVAREZ 60 1528 3.93
CHILPANCINGO DE LOS BRAVO 603 13397 4.50
COAHUAYUTLA DE JOSÉ MARÍA IZAZAGA 8 26 30.77
COCULA 27 206 13.11
COPALA 9 205 4.39
COPALILLO 5 39 12.82
COPANATOYAC 8 35 22.86
COYUCA DE BENÍTEZ 64 459 13.94
COYUCA DE CATALÁN 69 501 13.77
CUAJINICUILAPA 24 357 6.72
CUALÁC 4 37 10.81
CUAUTEPEC 11 90 12.22
CUETZALA DEL PROGRESO 6 58 10.34
CUTZAMALA DE PINZÓN 35 144 24.31
EDUARDO NERI 74 673 11.00
FLORENCIO VILLARREAL 17 306 5.56
GENERAL CANUTO A. NERI 3 12 25.00
GENERAL HELIODORO CASTILLO 17 482 3.53
HUAMUXTITLÁN 24 180 13.33
HUITZUCO DE LOS FIGUEROA 58 433 13.39
IGUALA DE LA INDEPENDENCIA 327 3273 9.99
IGUALAPA 12 278 4.32
ILIATENCO 4 6 66.67
IXCATEOPAN DE CUAUHTÉMOC 6 117 5.13
JUAN R. ESCUDERO 35 435 8.05
JUCHITÁN 12 109 11.01
LA UNIÓN DE ISIDORO MONTES DE OCA 43 242 17.77
LEONARDO BRAVO 19 158 12.03
MALINALTEPEC 8 70 11.43
MARQUELIA 16 261 6.13
MÁRTIR DE CUILAPAN 16 108 14.81
METLATÓNOC 5 26 19.23
MOCHITLÁN 12 294 4.08
OLINALÁ 13 71 18.31
OMETEPEC 95 1626 5.84
PEDRO ASCENCIO ALQUISIRAS 3 6 50.00
PETATLÁN 58 528 10.98
PILCAYA 8 69 11.59
PUNGARABATO 92 1039 8.85
QUECHULTENANGO 33 546 6.04
SAN LUIS ACATLÁN 21 302 6.95
SAN MARCOS 51 367 13.90
SAN MIGUEL TOTOLAPAN 20 178 11.24
TAXCO DE ALARCÓN 235 2414 9.73
TECOANAPA 30 723 4.15
TÉCPAN DE GALEANA 63 573 10.99
TELOLOAPAN 49 307 15.96
TEPECOACUILCO DE TRUJANO 36 209 17.22
TETIPAC 9 48 18.75
TIXTLA DE GUERRERO 53 1524 3.48
TLACOACHISTLAHUACA 9 94 9.57
TLACOAPA 2 17 11.76
TLALCHAPA 25 296 8.45
TLALIXTAQUILLA DE MALDONADO 10 128 7.81
TLAPA DE COMONFORT 127 1465 8.67
TLAPEHUALA 40 443 9.03
XALPATLÁHUAC 3 30 10.00
XOCHIHUEHUETLÁN 8 57 14.04
XOCHISTLAHUACA 15 414 3.62
ZAPOTITLÁN TABLAS 3 16 18.75
ZIHUATANEJO DE AZUETA 275 4819 5.71
ZIRÁNDARO 14 248 5.65
ZITLALA 5 109 4.59

- 2. (5%) % de casos positivos con al menos una comorbilidad a nivel municipal.

Filtramos la base de datos por todos los casos positivos con al menos una comorbilidad a nivel muncinical. A estos calculamos el total por cada municipio para posteriormente calcuar el porcentaje de casos positivos con al menos una comorbilidad por medio de una división entre el total de casos positivos.

Covid_Guerrero_Positivos<- Covid_Guerrero_Positivos %>% mutate(comorbilidad = case_when(TABAQUISMO==1|HIPERTENSION==1|DIABETES==1|CARDIOVASCULAR==1|ASMA==1|OTRA_COM==1|EPOC==1|RENAL_CRONICA==1|OBESIDAD==1|INMUSUPR==1 ~ 1, TRUE ~ 0))

Comorbo_Posi <- which(Covid_Guerrero_Positivos$comorbilidad == 1)

Comorbilidades <- aggregate(unos~MUNICIPIO, data = Covid_Guerrero_Positivos[Comorbo_Posi,], FUN = sum)

Comorbilidades1<- merge(x=Comorbilidades, y=P_x_Mun, by="MUNICIPIO")

Porcentaje_Comorbo_Posi<-data.frame(Municipio= Comorbilidades$MUNICIPIO, Porcentaje = round(Comorbilidades1$unos.x/Comorbilidades1$unos.y*100,2))

Porcentaje_Comorbo_Posi<-merge(x=Porcentaje_Comorbo_Posi,y=Comorbilidades1 , by.x="Municipio", by.y="MUNICIPIO")

Porcentaje_Comorbo_Posi<-Porcentaje_Comorbo_Posi[, c("Municipio","unos.x","unos.y","Porcentaje")]

Porcentaje_Comorbo_Posi %>% kbl(caption= "PORCENTAJE DE CASOS POSITIVOS CON AL MENOS UNA COMORBILIDAD", col.names = c("Municipio","Casos con al menos una comorbilidad","Casos totales","Porcentaje"))%>% kable_classic(full_width = F, html_font = "Cambria") %>% kable_paper(full_width = F) %>% column_spec(column = 4 , color = "White",bold = TRUE ,background = spec_color(Porcentaje_Comorbo_Posi$Porcentaje, option = "C", direction = -1 )) %>% scroll_box(width = "400px", height = "400px")
PORCENTAJE DE CASOS POSITIVOS CON AL MENOS UNA COMORBILIDAD
Municipio Casos con al menos una comorbilidad Casos totales Porcentaje
ACAPULCO DE JUÁREZ 10003 29446 33.97
ACATEPEC 12 42 28.57
AHUACUOTZINGO 119 253 47.04
AJUCHITLÁN DEL PROGRESO 130 317 41.01
ALCOZAUCA DE GUERRERO 39 108 36.11
ALPOYECA 45 101 44.55
APAXTLA 20 32 62.50
ARCELIA 150 382 39.27
ATENANGO DEL RÍO 17 31 54.84
ATLAMAJALCINGO DEL MONTE 6 13 46.15
ATLIXTAC 20 51 39.22
ATOYAC DE ÁLVAREZ 302 935 32.30
AYUTLA DE LOS LIBRES 330 887 37.20
AZOYÚ 98 238 41.18
BENITO JUÁREZ 68 309 22.01
BUENAVISTA DE CUÉLLAR 66 144 45.83
CHILAPA DE ÁLVAREZ 520 1528 34.03
CHILPANCINGO DE LOS BRAVO 4190 13397 31.28
COAHUAYUTLA DE JOSÉ MARÍA IZAZAGA 12 26 46.15
COCHOAPA EL GRANDE 9 23 39.13
COCULA 94 206 45.63
COPALA 44 205 21.46
COPALILLO 20 39 51.28
COPANATOYAC 15 35 42.86
COYUCA DE BENÍTEZ 140 459 30.50
COYUCA DE CATALÁN 170 501 33.93
CUAJINICUILAPA 128 357 35.85
CUALÁC 11 37 29.73
CUAUTEPEC 42 90 46.67
CUETZALA DEL PROGRESO 30 58 51.72
CUTZAMALA DE PINZÓN 76 144 52.78
EDUARDO NERI 243 673 36.11
FLORENCIO VILLARREAL 111 306 36.27
GENERAL CANUTO A. NERI 4 12 33.33
GENERAL HELIODORO CASTILLO 139 482 28.84
HUAMUXTITLÁN 97 180 53.89
HUITZUCO DE LOS FIGUEROA 210 433 48.50
IGUALA DE LA INDEPENDENCIA 1506 3273 46.01
IGUALAPA 91 278 32.73
ILIATENCO 3 6 50.00
IXCATEOPAN DE CUAUHTÉMOC 35 117 29.91
JOSÉ JOAQUÍN DE HERRERA 9 19 47.37
JUAN R. ESCUDERO 191 435 43.91
JUCHITÁN 40 109 36.70
LA UNIÓN DE ISIDORO MONTES DE OCA 111 242 45.87
LEONARDO BRAVO 51 158 32.28
MALINALTEPEC 36 70 51.43
MARQUELIA 105 261 40.23
MÁRTIR DE CUILAPAN 30 108 27.78
METLATÓNOC 2 26 7.69
MOCHITLÁN 94 294 31.97
NO ESPECIFICADO 1 1 100.00
OLINALÁ 34 71 47.89
OMETEPEC 498 1626 30.63
PEDRO ASCENCIO ALQUISIRAS 4 6 66.67
PETATLÁN 181 528 34.28
PILCAYA 33 69 47.83
PUNGARABATO 388 1039 37.34
QUECHULTENANGO 167 546 30.59
SAN LUIS ACATLÁN 123 302 40.73
SAN MARCOS 158 367 43.05
SAN MIGUEL TOTOLAPAN 70 178 39.33
TAXCO DE ALARCÓN 850 2414 35.21
TECOANAPA 337 723 46.61
TÉCPAN DE GALEANA 147 573 25.65
TELOLOAPAN 126 307 41.04
TEPECOACUILCO DE TRUJANO 107 209 51.20
TETIPAC 18 48 37.50
TIXTLA DE GUERRERO 458 1524 30.05
TLACOACHISTLAHUACA 31 94 32.98
TLACOAPA 6 17 35.29
TLALCHAPA 79 296 26.69
TLALIXTAQUILLA DE MALDONADO 41 128 32.03
TLAPA DE COMONFORT 619 1465 42.25
TLAPEHUALA 149 443 33.63
XALPATLÁHUAC 16 30 53.33
XOCHIHUEHUETLÁN 31 57 54.39
XOCHISTLAHUACA 163 414 39.37
ZAPOTITLÁN TABLAS 6 16 37.50
ZIHUATANEJO DE AZUETA 1256 4819 26.06
ZIRÁNDARO 112 248 45.16
ZITLALA 44 109 40.37

- 3. (10%) Total de casos positivos acumulados por día a nivel estatal.

Filtramos la base de datos para obtener los casos positivos de Covid y poder calcular su acumulado total por día.

Acumulado_estatal_P<- aggregate(unos~FECHA_SINTOMAS, data =  Covid_Guerrero_Positivos, FUN = sum)

Acumulado_estatal_P$Acumulado<-cumsum(Acumulado_estatal_P$unos)

Acumulado_estatal_P %>% kbl(caption= "TOTAL DE CASOS POSITIVOS ACUMULADOS POR DÍA A NIVEL ESTATAL", col.names = c("Fecha","Casos positivos ","Acumulados")) %>% kable_classic(full_width = F, html_font = "Cambria") %>% kable_paper(full_width = F) %>% column_spec(column = 3 , color = "White",bold = TRUE ,background = spec_color(Acumulado_estatal_P$Acumulado , option = "C", direction = -1 )) %>% scroll_box(width = "400px", height = "350px")
TOTAL DE CASOS POSITIVOS ACUMULADOS POR DÍA A NIVEL ESTATAL
Fecha Casos positivos Acumulados
2020-03-08 1 1
2020-03-09 1 2
2020-03-11 1 3
2020-03-12 1 4
2020-03-13 1 5
2020-03-15 3 8
2020-03-16 1 9
2020-03-17 3 12
2020-03-18 2 14
2020-03-19 2 16
2020-03-20 3 19
2020-03-21 3 22
2020-03-22 1 23
2020-03-23 3 26
2020-03-24 1 27
2020-03-25 1 28
2020-03-26 3 31
2020-03-28 1 32
2020-03-29 2 34
2020-03-30 4 38
2020-03-31 5 43
2020-04-01 4 47
2020-04-02 5 52
2020-04-03 8 60
2020-04-04 10 70
2020-04-05 6 76
2020-04-06 8 84
2020-04-07 5 89
2020-04-08 13 102
2020-04-09 6 108
2020-04-10 12 120
2020-04-11 9 129
2020-04-12 8 137
2020-04-13 15 152
2020-04-14 3 155
2020-04-15 14 169
2020-04-16 7 176
2020-04-17 9 185
2020-04-18 13 198
2020-04-19 17 215
2020-04-20 25 240
2020-04-21 17 257
2020-04-22 18 275
2020-04-23 25 300
2020-04-24 37 337
2020-04-25 35 372
2020-04-26 21 393
2020-04-27 24 417
2020-04-28 29 446
2020-04-29 36 482
2020-04-30 39 521
2020-05-01 59 580
2020-05-02 35 615
2020-05-03 47 662
2020-05-04 48 710
2020-05-05 39 749
2020-05-06 36 785
2020-05-07 40 825
2020-05-08 55 880
2020-05-09 60 940
2020-05-10 68 1008
2020-05-11 67 1075
2020-05-12 72 1147
2020-05-13 74 1221
2020-05-14 90 1311
2020-05-15 146 1457
2020-05-16 114 1571
2020-05-17 101 1672
2020-05-18 157 1829
2020-05-19 110 1939
2020-05-20 120 2059
2020-05-21 100 2159
2020-05-22 98 2257
2020-05-23 121 2378
2020-05-24 95 2473
2020-05-25 108 2581
2020-05-26 127 2708
2020-05-27 112 2820
2020-05-28 114 2934
2020-05-29 114 3048
2020-05-30 112 3160
2020-05-31 97 3257
2020-06-01 156 3413
2020-06-02 118 3531
2020-06-03 111 3642
2020-06-04 87 3729
2020-06-05 114 3843
2020-06-06 128 3971
2020-06-07 105 4076
2020-06-08 133 4209
2020-06-09 136 4345
2020-06-10 167 4512
2020-06-11 110 4622
2020-06-12 128 4750
2020-06-13 112 4862
2020-06-14 93 4955
2020-06-15 138 5093
2020-06-16 101 5194
2020-06-17 107 5301
2020-06-18 135 5436
2020-06-19 141 5577
2020-06-20 158 5735
2020-06-21 104 5839
2020-06-22 150 5989
2020-06-23 124 6113
2020-06-24 141 6254
2020-06-25 236 6490
2020-06-26 240 6730
2020-06-27 239 6969
2020-06-28 263 7232
2020-06-29 218 7450
2020-06-30 170 7620
2020-07-01 249 7869
2020-07-02 136 8005
2020-07-03 161 8166
2020-07-04 157 8323
2020-07-05 115 8438
2020-07-06 104 8542
2020-07-07 86 8628
2020-07-08 114 8742
2020-07-09 148 8890
2020-07-10 185 9075
2020-07-11 131 9206
2020-07-12 133 9339
2020-07-13 125 9464
2020-07-14 99 9563
2020-07-15 171 9734
2020-07-16 164 9898
2020-07-17 143 10041
2020-07-18 167 10208
2020-07-19 181 10389
2020-07-20 259 10648
2020-07-21 136 10784
2020-07-22 127 10911
2020-07-23 127 11038
2020-07-24 143 11181
2020-07-25 184 11365
2020-07-26 135 11500
2020-07-27 186 11686
2020-07-28 155 11841
2020-07-29 135 11976
2020-07-30 99 12075
2020-07-31 129 12204
2020-08-01 226 12430
2020-08-02 182 12612
2020-08-03 155 12767
2020-08-04 108 12875
2020-08-05 137 13012
2020-08-06 100 13112
2020-08-07 114 13226
2020-08-08 163 13389
2020-08-09 83 13472
2020-08-10 119 13591
2020-08-11 87 13678
2020-08-12 91 13769
2020-08-13 102 13871
2020-08-14 94 13965
2020-08-15 150 14115
2020-08-16 82 14197
2020-08-17 90 14287
2020-08-18 124 14411
2020-08-19 96 14507
2020-08-20 157 14664
2020-08-21 108 14772
2020-08-22 86 14858
2020-08-23 65 14923
2020-08-24 109 15032
2020-08-25 130 15162
2020-08-26 118 15280
2020-08-27 95 15375
2020-08-28 156 15531
2020-08-29 87 15618
2020-08-30 118 15736
2020-08-31 126 15862
2020-09-01 189 16051
2020-09-02 207 16258
2020-09-03 161 16419
2020-09-04 141 16560
2020-09-05 163 16723
2020-09-06 91 16814
2020-09-07 152 16966
2020-09-08 151 17117
2020-09-09 163 17280
2020-09-10 205 17485
2020-09-11 115 17600
2020-09-12 115 17715
2020-09-13 105 17820
2020-09-14 108 17928
2020-09-15 171 18099
2020-09-16 138 18237
2020-09-17 158 18395
2020-09-18 164 18559
2020-09-19 156 18715
2020-09-20 152 18867
2020-09-21 144 19011
2020-09-22 132 19143
2020-09-23 101 19244
2020-09-24 119 19363
2020-09-25 161 19524
2020-09-26 92 19616
2020-09-27 91 19707
2020-09-28 120 19827
2020-09-29 146 19973
2020-09-30 111 20084
2020-10-01 186 20270
2020-10-02 113 20383
2020-10-03 96 20479
2020-10-04 82 20561
2020-10-05 107 20668
2020-10-06 90 20758
2020-10-07 82 20840
2020-10-08 88 20928
2020-10-09 107 21035
2020-10-10 103 21138
2020-10-11 70 21208
2020-10-12 87 21295
2020-10-13 79 21374
2020-10-14 65 21439
2020-10-15 80 21519
2020-10-16 76 21595
2020-10-17 68 21663
2020-10-18 71 21734
2020-10-19 66 21800
2020-10-20 89 21889
2020-10-21 44 21933
2020-10-22 54 21987
2020-10-23 59 22046
2020-10-24 37 22083
2020-10-25 51 22134
2020-10-26 52 22186
2020-10-27 37 22223
2020-10-28 54 22277
2020-10-29 57 22334
2020-10-30 44 22378
2020-10-31 50 22428
2020-11-01 51 22479
2020-11-02 51 22530
2020-11-03 58 22588
2020-11-04 47 22635
2020-11-05 41 22676
2020-11-06 56 22732
2020-11-07 56 22788
2020-11-08 44 22832
2020-11-09 51 22883
2020-11-10 57 22940
2020-11-11 40 22980
2020-11-12 46 23026
2020-11-13 47 23073
2020-11-14 53 23126
2020-11-15 50 23176
2020-11-16 43 23219
2020-11-17 61 23280
2020-11-18 66 23346
2020-11-19 51 23397
2020-11-20 85 23482
2020-11-21 84 23566
2020-11-22 55 23621
2020-11-23 42 23663
2020-11-24 58 23721
2020-11-25 79 23800
2020-11-26 47 23847
2020-11-27 70 23917
2020-11-28 63 23980
2020-11-29 41 24021
2020-11-30 77 24098
2020-12-01 79 24177
2020-12-02 71 24248
2020-12-03 76 24324
2020-12-04 80 24404
2020-12-05 70 24474
2020-12-06 54 24528
2020-12-07 87 24615
2020-12-08 76 24691
2020-12-09 81 24772
2020-12-10 122 24894
2020-12-11 83 24977
2020-12-12 87 25064
2020-12-13 103 25167
2020-12-14 116 25283
2020-12-15 80 25363
2020-12-16 77 25440
2020-12-17 55 25495
2020-12-18 80 25575
2020-12-19 67 25642
2020-12-20 86 25728
2020-12-21 69 25797
2020-12-22 88 25885
2020-12-23 86 25971
2020-12-24 92 26063
2020-12-25 108 26171
2020-12-26 91 26262
2020-12-27 97 26359
2020-12-28 126 26485
2020-12-29 94 26579
2020-12-30 107 26686
2020-12-31 174 26860
2021-01-01 186 27046
2021-01-02 158 27204
2021-01-03 137 27341
2021-01-04 197 27538
2021-01-05 207 27745
2021-01-06 240 27985
2021-01-07 217 28202
2021-01-08 248 28450
2021-01-09 207 28657
2021-01-10 255 28912
2021-01-11 227 29139
2021-01-12 193 29332
2021-01-13 212 29544
2021-01-14 224 29768
2021-01-15 203 29971
2021-01-16 214 30185
2021-01-17 247 30432
2021-01-18 257 30689
2021-01-19 210 30899
2021-01-20 238 31137
2021-01-21 123 31260
2021-01-22 194 31454
2021-01-23 174 31628
2021-01-24 206 31834
2021-01-25 226 32060
2021-01-26 193 32253
2021-01-27 147 32400
2021-01-28 159 32559
2021-01-29 129 32688
2021-01-30 139 32827
2021-01-31 139 32966
2021-02-01 198 33164
2021-02-02 149 33313
2021-02-03 131 33444
2021-02-04 116 33560
2021-02-05 111 33671
2021-02-06 87 33758
2021-02-07 76 33834
2021-02-08 101 33935
2021-02-09 99 34034
2021-02-10 110 34144
2021-02-11 69 34213
2021-02-12 91 34304
2021-02-13 80 34384
2021-02-14 99 34483
2021-02-15 90 34573
2021-02-16 78 34651
2021-02-17 63 34714
2021-02-18 86 34800
2021-02-19 91 34891
2021-02-20 96 34987
2021-02-21 76 35063
2021-02-22 61 35124
2021-02-23 77 35201
2021-02-24 96 35297
2021-02-25 76 35373
2021-02-26 71 35444
2021-02-27 76 35520
2021-02-28 109 35629
2021-03-01 136 35765
2021-03-02 62 35827
2021-03-03 80 35907
2021-03-04 74 35981
2021-03-05 76 36057
2021-03-06 69 36126
2021-03-07 61 36187
2021-03-08 101 36288
2021-03-09 56 36344
2021-03-10 57 36401
2021-03-11 60 36461
2021-03-12 73 36534
2021-03-13 58 36592
2021-03-14 65 36657
2021-03-15 70 36727
2021-03-16 85 36812
2021-03-17 53 36865
2021-03-18 92 36957
2021-03-19 63 37020
2021-03-20 78 37098
2021-03-21 65 37163
2021-03-22 62 37225
2021-03-23 42 37267
2021-03-24 57 37324
2021-03-25 49 37373
2021-03-26 61 37434
2021-03-27 53 37487
2021-03-28 66 37553
2021-03-29 76 37629
2021-03-30 49 37678
2021-03-31 66 37744
2021-04-01 64 37808
2021-04-02 69 37877
2021-04-03 81 37958
2021-04-04 73 38031
2021-04-05 73 38104
2021-04-06 66 38170
2021-04-07 85 38255
2021-04-08 78 38333
2021-04-09 82 38415
2021-04-10 83 38498
2021-04-11 70 38568
2021-04-12 58 38626
2021-04-13 53 38679
2021-04-14 59 38738
2021-04-15 56 38794
2021-04-16 56 38850
2021-04-17 62 38912
2021-04-18 50 38962
2021-04-19 64 39026
2021-04-20 62 39088
2021-04-21 51 39139
2021-04-22 45 39184
2021-04-23 48 39232
2021-04-24 63 39295
2021-04-25 56 39351
2021-04-26 63 39414
2021-04-27 56 39470
2021-04-28 58 39528
2021-04-29 50 39578
2021-04-30 73 39651
2021-05-01 89 39740
2021-05-02 57 39797
2021-05-03 64 39861
2021-05-04 59 39920
2021-05-05 71 39991
2021-05-06 41 40032
2021-05-07 61 40093
2021-05-08 41 40134
2021-05-09 42 40176
2021-05-10 63 40239
2021-05-11 35 40274
2021-05-12 31 40305
2021-05-13 32 40337
2021-05-14 34 40371
2021-05-15 42 40413
2021-05-16 35 40448
2021-05-17 38 40486
2021-05-18 41 40527
2021-05-19 28 40555
2021-05-20 37 40592
2021-05-21 51 40643
2021-05-22 33 40676
2021-05-23 19 40695
2021-05-24 32 40727
2021-05-25 25 40752
2021-05-26 21 40773
2021-05-27 21 40794
2021-05-28 31 40825
2021-05-29 22 40847
2021-05-30 17 40864
2021-05-31 19 40883
2021-06-01 25 40908
2021-06-02 27 40935
2021-06-03 21 40956
2021-06-04 25 40981
2021-06-05 20 41001
2021-06-06 22 41023
2021-06-07 19 41042
2021-06-08 17 41059
2021-06-09 15 41074
2021-06-10 20 41094
2021-06-11 17 41111
2021-06-12 29 41140
2021-06-13 19 41159
2021-06-14 8 41167
2021-06-15 18 41185
2021-06-16 30 41215
2021-06-17 28 41243
2021-06-18 27 41270
2021-06-19 26 41296
2021-06-20 34 41330
2021-06-21 33 41363
2021-06-22 39 41402
2021-06-23 40 41442
2021-06-24 39 41481
2021-06-25 61 41542
2021-06-26 57 41599
2021-06-27 69 41668
2021-06-28 89 41757
2021-06-29 97 41854
2021-06-30 96 41950
2021-07-01 186 42136
2021-07-02 184 42320
2021-07-03 227 42547
2021-07-04 275 42822
2021-07-05 309 43131
2021-07-06 297 43428
2021-07-07 267 43695
2021-07-08 338 44033
2021-07-09 401 44434
2021-07-10 570 45004
2021-07-11 441 45445
2021-07-12 582 46027
2021-07-13 438 46465
2021-07-14 411 46876
2021-07-15 600 47476
2021-07-16 690 48166
2021-07-17 754 48920
2021-07-18 803 49723
2021-07-19 862 50585
2021-07-20 844 51429
2021-07-21 569 51998
2021-07-22 588 52586
2021-07-23 748 53334
2021-07-24 825 54159
2021-07-25 868 55027
2021-07-26 813 55840
2021-07-27 732 56572
2021-07-28 646 57218
2021-07-29 612 57830
2021-07-30 731 58561
2021-07-31 751 59312
2021-08-01 1026 60338
2021-08-02 743 61081
2021-08-03 582 61663
2021-08-04 537 62200
2021-08-05 619 62819
2021-08-06 668 63487
2021-08-07 591 64078
2021-08-08 626 64704
2021-08-09 594 65298
2021-08-10 553 65851
2021-08-11 414 66265
2021-08-12 436 66701
2021-08-13 489 67190
2021-08-14 438 67628
2021-08-15 463 68091
2021-08-16 428 68519
2021-08-17 309 68828
2021-08-18 316 69144
2021-08-19 296 69440
2021-08-20 418 69858
2021-08-21 298 70156
2021-08-22 249 70405
2021-08-23 245 70650
2021-08-24 208 70858
2021-08-25 192 71050
2021-08-26 182 71232
2021-08-27 204 71436
2021-08-28 219 71655
2021-08-29 184 71839
2021-08-30 229 72068
2021-08-31 182 72250
2021-09-01 203 72453
2021-09-02 196 72649
2021-09-03 179 72828
2021-09-04 169 72997
2021-09-05 160 73157
2021-09-06 168 73325
2021-09-07 103 73428
2021-09-08 96 73524
2021-09-09 117 73641
2021-09-10 122 73763
2021-09-11 93 73856
2021-09-12 83 73939
2021-09-13 59 73998
2021-09-14 64 74062
2021-09-15 84 74146
2021-09-16 65 74211
2021-09-17 72 74283
2021-09-18 70 74353
2021-09-19 57 74410
2021-09-20 80 74490
2021-09-21 43 74533
2021-09-22 38 74571
2021-09-23 51 74622
2021-09-24 58 74680
2021-09-25 48 74728
2021-09-26 56 74784
2021-09-27 33 74817
2021-09-28 46 74863
2021-09-29 31 74894
2021-09-30 34 74928
2021-10-01 62 74990
2021-10-02 49 75039
2021-10-03 21 75060
2021-10-04 58 75118
2021-10-05 27 75145
2021-10-06 23 75168
2021-10-07 25 75193
2021-10-08 41 75234
2021-10-09 23 75257
2021-10-10 38 75295
2021-10-11 19 75314
2021-10-12 32 75346
2021-10-13 26 75372
2021-10-14 33 75405
2021-10-15 35 75440
2021-10-16 29 75469
2021-10-17 47 75516
2021-10-18 29 75545
2021-10-19 51 75596
2021-10-20 36 75632
2021-10-21 25 75657
2021-10-22 23 75680
2021-10-23 29 75709
2021-10-24 39 75748
2021-10-25 47 75795
2021-10-26 31 75826
2021-10-27 30 75856
2021-10-28 18 75874
2021-10-29 28 75902
2021-10-30 20 75922
2021-10-31 29 75951
2021-11-01 29 75980
2021-11-02 29 76009
2021-11-03 32 76041
2021-11-04 28 76069
2021-11-05 36 76105
2021-11-06 26 76131
2021-11-07 20 76151
2021-11-08 17 76168
2021-11-09 20 76188
2021-11-10 15 76203
2021-11-11 17 76220
2021-11-12 17 76237
2021-11-13 14 76251
2021-11-14 8 76259
2021-11-15 14 76273
2021-11-16 7 76280
2021-11-17 9 76289
2021-11-18 11 76300
2021-11-19 15 76315
2021-11-20 36 76351
2021-11-21 15 76366
2021-11-22 18 76384
2021-11-23 10 76394
2021-11-24 4 76398
2021-11-25 18 76416
2021-11-26 9 76425
2021-11-27 13 76438
2021-11-28 14 76452
2021-11-29 11 76463
2021-11-30 11 76474
2021-12-01 14 76488
2021-12-02 2 76490
2021-12-03 8 76498
2021-12-04 9 76507
2021-12-05 11 76518
2021-12-06 8 76526
2021-12-07 8 76534
2021-12-08 5 76539
2021-12-09 3 76542
2021-12-11 1 76543

- 4. (10%) Total acumulado de defunciones por día a nivel estatal.

Filtramos la base de datos para obtener las defunciones por Covid y poder calcular su acumulado total por día.

Acumulado_estatal_D<- aggregate(unos~FECHA_DEF, data = Covid_Guerrero_Positivos[-Defunciones,], FUN = sum)

Acumulado_estatal_D$Acumulado<-cumsum(Acumulado_estatal_D$unos)

Acumulado_estatal_D %>% kbl(caption= "TOTAL ACUMULADO DE DEFUNCIONES A NIVEL ESTATAL", col.names = c("Fecha","Defunciones por día","Acumulado")) %>% kable_classic(full_width = F, html_font = "Cambria") %>% kable_paper(full_width = F) %>% column_spec(column = 3 , color = "White",bold = TRUE ,background = spec_color(Acumulado_estatal_D$Acumulado , option = "C", direction = -1 )) %>% scroll_box(width = "400px", height = "400px") 
TOTAL ACUMULADO DE DEFUNCIONES A NIVEL ESTATAL
Fecha Defunciones por día Acumulado
2020-03-28 1 1
2020-04-04 2 3
2020-04-06 2 5
2020-04-09 1 6
2020-04-12 1 7
2020-04-13 1 8
2020-04-14 1 9
2020-04-15 3 12
2020-04-17 1 13
2020-04-18 3 16
2020-04-19 4 20
2020-04-20 3 23
2020-04-21 7 30
2020-04-22 3 33
2020-04-23 3 36
2020-04-24 1 37
2020-04-25 4 41
2020-04-26 1 42
2020-04-27 8 50
2020-04-28 5 55
2020-04-29 4 59
2020-04-30 2 61
2020-05-01 2 63
2020-05-02 8 71
2020-05-03 4 75
2020-05-04 5 80
2020-05-05 6 86
2020-05-06 10 96
2020-05-07 6 102
2020-05-08 4 106
2020-05-09 11 117
2020-05-10 6 123
2020-05-11 9 132
2020-05-12 7 139
2020-05-13 9 148
2020-05-14 9 157
2020-05-15 14 171
2020-05-16 13 184
2020-05-17 16 200
2020-05-18 18 218
2020-05-19 13 231
2020-05-20 23 254
2020-05-21 17 271
2020-05-22 19 290
2020-05-23 19 309
2020-05-24 21 330
2020-05-25 28 358
2020-05-26 23 381
2020-05-27 26 407
2020-05-28 17 424
2020-05-29 22 446
2020-05-30 17 463
2020-05-31 24 487
2020-06-01 22 509
2020-06-02 28 537
2020-06-03 18 555
2020-06-04 18 573
2020-06-05 23 596
2020-06-06 19 615
2020-06-07 24 639
2020-06-08 24 663
2020-06-09 21 684
2020-06-10 24 708
2020-06-11 18 726
2020-06-12 18 744
2020-06-13 27 771
2020-06-14 23 794
2020-06-15 17 811
2020-06-16 20 831
2020-06-17 27 858
2020-06-18 21 879
2020-06-19 30 909
2020-06-20 14 923
2020-06-21 16 939
2020-06-22 29 968
2020-06-23 16 984
2020-06-24 16 1000
2020-06-25 16 1016
2020-06-26 24 1040
2020-06-27 26 1066
2020-06-28 21 1087
2020-06-29 20 1107
2020-06-30 22 1129
2020-07-01 13 1142
2020-07-02 11 1153
2020-07-03 16 1169
2020-07-04 21 1190
2020-07-05 14 1204
2020-07-06 15 1219
2020-07-07 23 1242
2020-07-08 9 1251
2020-07-09 12 1263
2020-07-10 17 1280
2020-07-11 15 1295
2020-07-12 10 1305
2020-07-13 17 1322
2020-07-14 24 1346
2020-07-15 14 1360
2020-07-16 9 1369
2020-07-17 14 1383
2020-07-18 16 1399
2020-07-19 16 1415
2020-07-20 14 1429
2020-07-21 16 1445
2020-07-22 12 1457
2020-07-23 15 1472
2020-07-24 12 1484
2020-07-25 16 1500
2020-07-26 17 1517
2020-07-27 9 1526
2020-07-28 7 1533
2020-07-29 7 1540
2020-07-30 13 1553
2020-07-31 11 1564
2020-08-01 11 1575
2020-08-02 12 1587
2020-08-03 12 1599
2020-08-04 14 1613
2020-08-05 9 1622
2020-08-06 7 1629
2020-08-07 15 1644
2020-08-08 7 1651
2020-08-09 10 1661
2020-08-10 7 1668
2020-08-11 12 1680
2020-08-12 4 1684
2020-08-13 14 1698
2020-08-14 4 1702
2020-08-15 13 1715
2020-08-16 16 1731
2020-08-17 8 1739
2020-08-18 12 1751
2020-08-19 19 1770
2020-08-20 10 1780
2020-08-21 6 1786
2020-08-22 9 1795
2020-08-23 6 1801
2020-08-24 9 1810
2020-08-25 11 1821
2020-08-26 8 1829
2020-08-27 7 1836
2020-08-28 6 1842
2020-08-29 14 1856
2020-08-30 5 1861
2020-08-31 4 1865
2020-09-01 4 1869
2020-09-02 5 1874
2020-09-03 8 1882
2020-09-04 4 1886
2020-09-05 8 1894
2020-09-06 2 1896
2020-09-07 13 1909
2020-09-08 2 1911
2020-09-09 11 1922
2020-09-10 6 1928
2020-09-11 3 1931
2020-09-12 15 1946
2020-09-13 14 1960
2020-09-14 5 1965
2020-09-15 12 1977
2020-09-16 7 1984
2020-09-17 4 1988
2020-09-18 5 1993
2020-09-19 2 1995
2020-09-20 7 2002
2020-09-21 13 2015
2020-09-22 7 2022
2020-09-23 15 2037
2020-09-24 7 2044
2020-09-25 5 2049
2020-09-26 14 2063
2020-09-27 11 2074
2020-09-28 8 2082
2020-09-29 5 2087
2020-09-30 9 2096
2020-10-01 13 2109
2020-10-02 10 2119
2020-10-03 13 2132
2020-10-04 4 2136
2020-10-05 10 2146
2020-10-06 7 2153
2020-10-07 9 2162
2020-10-08 14 2176
2020-10-09 11 2187
2020-10-10 9 2196
2020-10-11 9 2205
2020-10-12 12 2217
2020-10-13 11 2228
2020-10-14 5 2233
2020-10-15 12 2245
2020-10-16 7 2252
2020-10-17 6 2258
2020-10-18 9 2267
2020-10-19 8 2275
2020-10-20 2 2277
2020-10-21 4 2281
2020-10-22 6 2287
2020-10-23 6 2293
2020-10-24 5 2298
2020-10-25 7 2305
2020-10-26 5 2310
2020-10-27 8 2318
2020-10-28 5 2323
2020-10-29 8 2331
2020-10-30 5 2336
2020-10-31 7 2343
2020-11-01 11 2354
2020-11-02 2 2356
2020-11-03 8 2364
2020-11-04 7 2371
2020-11-05 5 2376
2020-11-06 6 2382
2020-11-07 8 2390
2020-11-08 5 2395
2020-11-09 7 2402
2020-11-10 4 2406
2020-11-11 6 2412
2020-11-12 4 2416
2020-11-13 3 2419
2020-11-14 10 2429
2020-11-15 4 2433
2020-11-16 4 2437
2020-11-17 6 2443
2020-11-18 3 2446
2020-11-19 8 2454
2020-11-20 4 2458
2020-11-21 3 2461
2020-11-22 3 2464
2020-11-24 4 2468
2020-11-25 4 2472
2020-11-26 9 2481
2020-11-27 2 2483
2020-11-28 2 2485
2020-11-29 7 2492
2020-11-30 2 2494
2020-12-01 5 2499
2020-12-02 7 2506
2020-12-03 6 2512
2020-12-04 6 2518
2020-12-05 8 2526
2020-12-06 8 2534
2020-12-07 9 2543
2020-12-08 2 2545
2020-12-09 11 2556
2020-12-10 5 2561
2020-12-11 6 2567
2020-12-12 6 2573
2020-12-13 11 2584
2020-12-14 3 2587
2020-12-15 18 2605
2020-12-16 5 2610
2020-12-17 5 2615
2020-12-18 6 2621
2020-12-19 5 2626
2020-12-20 10 2636
2020-12-21 9 2645
2020-12-22 8 2653
2020-12-23 6 2659
2020-12-24 4 2663
2020-12-25 8 2671
2020-12-26 6 2677
2020-12-27 8 2685
2020-12-28 8 2693
2020-12-29 8 2701
2020-12-30 8 2709
2020-12-31 5 2714
2021-01-01 4 2718
2021-01-02 12 2730
2021-01-03 10 2740
2021-01-04 10 2750
2021-01-05 17 2767
2021-01-06 13 2780
2021-01-07 11 2791
2021-01-08 6 2797
2021-01-09 8 2805
2021-01-10 18 2823
2021-01-11 13 2836
2021-01-12 10 2846
2021-01-13 19 2865
2021-01-14 16 2881
2021-01-15 18 2899
2021-01-16 24 2923
2021-01-17 12 2935
2021-01-18 18 2953
2021-01-19 24 2977
2021-01-20 22 2999
2021-01-21 17 3016
2021-01-22 28 3044
2021-01-23 17 3061
2021-01-24 31 3092
2021-01-25 20 3112
2021-01-26 30 3142
2021-01-27 28 3170
2021-01-28 24 3194
2021-01-29 21 3215
2021-01-30 21 3236
2021-01-31 27 3263
2021-02-01 19 3282
2021-02-02 20 3302
2021-02-03 28 3330
2021-02-04 19 3349
2021-02-05 17 3366
2021-02-06 14 3380
2021-02-07 23 3403
2021-02-08 23 3426
2021-02-09 15 3441
2021-02-10 10 3451
2021-02-11 24 3475
2021-02-12 23 3498
2021-02-13 15 3513
2021-02-14 19 3532
2021-02-15 22 3554
2021-02-16 22 3576
2021-02-17 12 3588
2021-02-18 14 3602
2021-02-19 22 3624
2021-02-20 12 3636
2021-02-21 16 3652
2021-02-22 19 3671
2021-02-23 16 3687
2021-02-24 18 3705
2021-02-25 8 3713
2021-02-26 12 3725
2021-02-27 9 3734
2021-02-28 17 3751
2021-03-01 8 3759
2021-03-02 8 3767
2021-03-03 14 3781
2021-03-04 14 3795
2021-03-05 6 3801
2021-03-06 10 3811
2021-03-07 12 3823
2021-03-08 15 3838
2021-03-09 9 3847
2021-03-10 9 3856
2021-03-11 11 3867
2021-03-12 15 3882
2021-03-13 5 3887
2021-03-14 9 3896
2021-03-15 14 3910
2021-03-16 11 3921
2021-03-17 11 3932
2021-03-18 12 3944
2021-03-19 8 3952
2021-03-20 8 3960
2021-03-21 9 3969
2021-03-22 2 3971
2021-03-23 10 3981
2021-03-24 7 3988
2021-03-25 7 3995
2021-03-26 5 4000
2021-03-27 3 4003
2021-03-28 8 4011
2021-03-29 11 4022
2021-03-30 9 4031
2021-03-31 10 4041
2021-04-01 3 4044
2021-04-02 6 4050
2021-04-03 2 4052
2021-04-04 9 4061
2021-04-05 9 4070
2021-04-06 8 4078
2021-04-07 3 4081
2021-04-08 5 4086
2021-04-09 3 4089
2021-04-10 7 4096
2021-04-11 9 4105
2021-04-12 7 4112
2021-04-13 12 4124
2021-04-14 10 4134
2021-04-15 6 4140
2021-04-16 6 4146
2021-04-17 6 4152
2021-04-18 5 4157
2021-04-19 8 4165
2021-04-20 9 4174
2021-04-21 7 4181
2021-04-22 3 4184
2021-04-23 4 4188
2021-04-24 2 4190
2021-04-25 7 4197
2021-04-26 8 4205
2021-04-27 2 4207
2021-04-28 2 4209
2021-04-29 4 4213
2021-04-30 4 4217
2021-05-01 9 4226
2021-05-02 5 4231
2021-05-03 6 4237
2021-05-04 2 4239
2021-05-05 3 4242
2021-05-06 5 4247
2021-05-07 2 4249
2021-05-08 2 4251
2021-05-09 5 4256
2021-05-10 3 4259
2021-05-11 4 4263
2021-05-12 3 4266
2021-05-13 3 4269
2021-05-14 2 4271
2021-05-15 1 4272
2021-05-16 3 4275
2021-05-17 5 4280
2021-05-18 2 4282
2021-05-19 3 4285
2021-05-20 4 4289
2021-05-21 4 4293
2021-05-23 1 4294
2021-05-24 4 4298
2021-05-25 3 4301
2021-05-26 3 4304
2021-05-27 1 4305
2021-05-28 3 4308
2021-05-29 5 4313
2021-05-30 5 4318
2021-05-31 6 4324
2021-06-02 2 4326
2021-06-03 1 4327
2021-06-04 2 4329
2021-06-05 2 4331
2021-06-06 1 4332
2021-06-07 4 4336
2021-06-08 1 4337
2021-06-09 3 4340
2021-06-10 1 4341
2021-06-11 2 4343
2021-06-12 3 4346
2021-06-13 2 4348
2021-06-14 6 4354
2021-06-15 3 4357
2021-06-16 3 4360
2021-06-20 3 4363
2021-06-22 1 4364
2021-06-23 1 4365
2021-06-24 2 4367
2021-06-26 5 4372
2021-06-27 2 4374
2021-06-28 1 4375
2021-06-30 1 4376
2021-07-02 2 4378
2021-07-03 1 4379
2021-07-04 3 4382
2021-07-06 2 4384
2021-07-07 3 4387
2021-07-08 3 4390
2021-07-09 2 4392
2021-07-10 3 4395
2021-07-11 6 4401
2021-07-12 7 4408
2021-07-13 4 4412
2021-07-14 6 4418
2021-07-15 7 4425
2021-07-16 7 4432
2021-07-17 11 4443
2021-07-18 8 4451
2021-07-19 13 4464
2021-07-20 18 4482
2021-07-21 15 4497
2021-07-22 7 4504
2021-07-23 27 4531
2021-07-24 26 4557
2021-07-25 17 4574
2021-07-26 16 4590
2021-07-27 27 4617
2021-07-28 27 4644
2021-07-29 22 4666
2021-07-30 23 4689
2021-07-31 35 4724
2021-08-01 22 4746
2021-08-02 22 4768
2021-08-03 31 4799
2021-08-04 44 4843
2021-08-05 33 4876
2021-08-06 34 4910
2021-08-07 32 4942
2021-08-08 26 4968
2021-08-09 37 5005
2021-08-10 22 5027
2021-08-11 29 5056
2021-08-12 24 5080
2021-08-13 27 5107
2021-08-14 22 5129
2021-08-15 30 5159
2021-08-16 26 5185
2021-08-17 21 5206
2021-08-18 30 5236
2021-08-19 25 5261
2021-08-20 30 5291
2021-08-21 23 5314
2021-08-22 27 5341
2021-08-23 30 5371
2021-08-24 24 5395
2021-08-25 23 5418
2021-08-26 29 5447
2021-08-27 21 5468
2021-08-28 19 5487
2021-08-29 27 5514
2021-08-30 22 5536
2021-08-31 19 5555
2021-09-01 15 5570
2021-09-02 16 5586
2021-09-03 20 5606
2021-09-04 13 5619
2021-09-05 12 5631
2021-09-06 13 5644
2021-09-07 11 5655
2021-09-08 14 5669
2021-09-09 15 5684
2021-09-10 13 5697
2021-09-11 10 5707
2021-09-12 12 5719
2021-09-13 13 5732
2021-09-14 5 5737
2021-09-15 13 5750
2021-09-16 8 5758
2021-09-17 3 5761
2021-09-18 5 5766
2021-09-19 13 5779
2021-09-20 9 5788
2021-09-21 5 5793
2021-09-22 6 5799
2021-09-23 5 5804
2021-09-24 7 5811
2021-09-25 9 5820
2021-09-26 7 5827
2021-09-27 13 5840
2021-09-28 2 5842
2021-09-29 3 5845
2021-09-30 1 5846
2021-10-01 5 5851
2021-10-02 3 5854
2021-10-03 5 5859
2021-10-04 7 5866
2021-10-05 6 5872
2021-10-06 2 5874
2021-10-07 5 5879
2021-10-08 7 5886
2021-10-09 6 5892
2021-10-10 2 5894
2021-10-11 4 5898
2021-10-12 6 5904
2021-10-13 9 5913
2021-10-14 4 5917
2021-10-15 6 5923
2021-10-16 4 5927
2021-10-17 6 5933
2021-10-18 2 5935
2021-10-19 6 5941
2021-10-20 2 5943
2021-10-21 2 5945
2021-10-22 2 5947
2021-10-23 7 5954
2021-10-24 4 5958
2021-10-25 2 5960
2021-10-26 3 5963
2021-10-27 2 5965
2021-10-28 1 5966
2021-10-29 3 5969
2021-10-30 2 5971
2021-10-31 4 5975
2021-11-01 3 5978
2021-11-02 3 5981
2021-11-03 6 5987
2021-11-04 4 5991
2021-11-05 4 5995
2021-11-06 2 5997
2021-11-07 2 5999
2021-11-08 2 6001
2021-11-09 1 6002
2021-11-10 1 6003
2021-11-11 1 6004
2021-11-12 1 6005
2021-11-13 1 6006
2021-11-14 4 6010
2021-11-15 5 6015
2021-11-17 3 6018
2021-11-18 3 6021
2021-11-19 1 6022
2021-11-20 3 6025
2021-11-21 2 6027
2021-11-23 1 6028
2021-11-25 1 6029
2021-11-26 2 6031
2021-11-27 6 6037
2021-11-29 1 6038
2021-11-30 1 6039
2021-12-01 3 6042
2021-12-02 1 6043
2021-12-03 4 6047
2021-12-05 1 6048
2021-12-06 1 6049
2021-12-10 1 6050

- 5. (10%) % de mujeres, a nivel municipal, que representan un caso positivo (Número de mujeres positivas en el municipio/ Número de casos positivos en ese municipio)

Filtramos la base por solo mujeres (1) y por mujeres con Covid en cada municipio para posteriormente calcular el porcentajde mujeres, a nivel municpal, que representen un caso positico por medio de una división entre el total de casos positivo de dicho municipio

M_Pos<-which(Covid_Guerrero_Positivos$SEXO==1)

Muj_Pos_G<- aggregate(unos~MUNICIPIO, Covid_Guerrero_Positivos[M_Pos,],sum)

Muj_Pos_G<-merge(x=Muj_Pos_G, y=P_x_Mun, by="MUNICIPIO")

Porc_Muj_Pos_G<-data.frame(Municipio = Muj_Pos_G$MUNICIPIO, Porcentaje = round(Muj_Pos_G$unos.x/Muj_Pos_G$unos.y*100,2))

Porc_Muj_Pos_G<-merge(x=Porc_Muj_Pos_G, y= Muj_Pos_G, by.x="Municipio", by.y="MUNICIPIO")

Porc_Muj_Pos_G<-Porc_Muj_Pos_G[, c("Municipio","unos.x","unos.y","Porcentaje")]

Porc_Muj_Pos_G %>% kbl(caption= "Porcentaje de mujeres, a nivel municipal que representan un caso positivo", col.names = c("Municipio","Mujeres positivas","Casos totales","Porcentaje"))%>% kable_classic(full_width = F, html_font = "Cambria") %>% kable_paper(full_width = F) %>% column_spec(column = 4 , color = "White",bold = TRUE ,background = spec_color(Porc_Muj_Pos_G$Porcentaje , option = "C", direction = -1 )) %>% scroll_box(width = "400px", height = "400px")
Porcentaje de mujeres, a nivel municipal que representan un caso positivo
Municipio Mujeres positivas Casos totales Porcentaje
ACAPULCO DE JUÁREZ 14532 29446 49.35
ACATEPEC 18 42 42.86
AHUACUOTZINGO 137 253 54.15
AJUCHITLÁN DEL PROGRESO 157 317 49.53
ALCOZAUCA DE GUERRERO 58 108 53.70
ALPOYECA 56 101 55.45
APAXTLA 10 32 31.25
ARCELIA 202 382 52.88
ATENANGO DEL RÍO 14 31 45.16
ATLAMAJALCINGO DEL MONTE 9 13 69.23
ATLIXTAC 29 51 56.86
ATOYAC DE ÁLVAREZ 462 935 49.41
AYUTLA DE LOS LIBRES 478 887 53.89
AZOYÚ 122 238 51.26
BENITO JUÁREZ 146 309 47.25
BUENAVISTA DE CUÉLLAR 69 144 47.92
CHILAPA DE ÁLVAREZ 776 1528 50.79
CHILPANCINGO DE LOS BRAVO 6837 13397 51.03
COAHUAYUTLA DE JOSÉ MARÍA IZAZAGA 13 26 50.00
COCHOAPA EL GRANDE 8 23 34.78
COCULA 87 206 42.23
COPALA 112 205 54.63
COPALILLO 25 39 64.10
COPANATOYAC 15 35 42.86
COYUCA DE BENÍTEZ 210 459 45.75
COYUCA DE CATALÁN 259 501 51.70
CUAJINICUILAPA 209 357 58.54
CUALÁC 18 37 48.65
CUAUTEPEC 44 90 48.89
CUETZALA DEL PROGRESO 33 58 56.90
CUTZAMALA DE PINZÓN 71 144 49.31
EDUARDO NERI 317 673 47.10
FLORENCIO VILLARREAL 169 306 55.23
GENERAL CANUTO A. NERI 3 12 25.00
GENERAL HELIODORO CASTILLO 246 482 51.04
HUAMUXTITLÁN 90 180 50.00
HUITZUCO DE LOS FIGUEROA 232 433 53.58
IGUALA DE LA INDEPENDENCIA 1578 3273 48.21
IGUALAPA 144 278 51.80
IXCATEOPAN DE CUAUHTÉMOC 59 117 50.43
JOSÉ JOAQUÍN DE HERRERA 8 19 42.11
JUAN R. ESCUDERO 211 435 48.51
JUCHITÁN 64 109 58.72
LA UNIÓN DE ISIDORO MONTES DE OCA 105 242 43.39
LEONARDO BRAVO 83 158 52.53
MALINALTEPEC 34 70 48.57
MARQUELIA 134 261 51.34
MÁRTIR DE CUILAPAN 52 108 48.15
METLATÓNOC 13 26 50.00
MOCHITLÁN 167 294 56.80
NO ESPECIFICADO 1 1 100.00
OLINALÁ 37 71 52.11
OMETEPEC 843 1626 51.85
PEDRO ASCENCIO ALQUISIRAS 2 6 33.33
PETATLÁN 263 528 49.81
PILCAYA 32 69 46.38
PUNGARABATO 495 1039 47.64
QUECHULTENANGO 271 546 49.63
SAN LUIS ACATLÁN 176 302 58.28
SAN MARCOS 196 367 53.41
SAN MIGUEL TOTOLAPAN 88 178 49.44
TAXCO DE ALARCÓN 1223 2414 50.66
TECOANAPA 375 723 51.87
TÉCPAN DE GALEANA 260 573 45.38
TELOLOAPAN 135 307 43.97
TEPECOACUILCO DE TRUJANO 83 209 39.71
TETIPAC 19 48 39.58
TIXTLA DE GUERRERO 750 1524 49.21
TLACOACHISTLAHUACA 54 94 57.45
TLACOAPA 11 17 64.71
TLALCHAPA 131 296 44.26
TLALIXTAQUILLA DE MALDONADO 59 128 46.09
TLAPA DE COMONFORT 769 1465 52.49
TLAPEHUALA 219 443 49.44
XALPATLÁHUAC 17 30 56.67
XOCHIHUEHUETLÁN 33 57 57.89
XOCHISTLAHUACA 222 414 53.62
ZAPOTITLÁN TABLAS 7 16 43.75
ZIHUATANEJO DE AZUETA 2422 4819 50.26
ZIRÁNDARO 117 248 47.18
ZITLALA 55 109 50.46

EJERCICIO 2

2. (10%) Gráfico de barras de los 10 municipios con mayor % de defunciones.

Se filtra la base de datos por los 1o muncipios con mayor porcentaje de defunciones por Covid

Top_10_Mun_P<-Porcentaje %>% arrange(desc(porcentaje)) %>% top_n(10)
## Selecting by porcentaje
textoss2<-paste("Municipio:",Top_10_Mun_P$Municipio,"\n", "Porcentaje defunciones por COVID:", Top_10_Mun_P$porcentaje)

bar_graf2<- Top_10_Mun_P %>% ggplot(aes(x=porcentaje, y=MUNICIPIO, text=textoss2)) + theme_dark() + theme(text = element_text(size = 9), plot.title = element_text(hjust = 0.5),)+ geom_bar(stat = "identity",color = "white",fill = "darkcyan",width = .7,lwd=0.1) +labs(title = "Top 10 - Porcentaje de defunciones por Covid en Guerrero", x = "Porcentaje", y = "Municipio")

ggplotly(bar_graf2,tooltip = c("text"))

EJERCICIO 3

3. (15%) Gráfico de barras de los 10 municipios con mayor número de casos positivos detectados, divido por hombres y por mujeres.

En este caso de filtra la base de de datos por casos positivos de Covid a nivel municipal entre mujeres y hombres.

Casos_Sex_Mun<-aggregate(unos~MUNICIPIO + SEXO, Covid_Guerrero_Positivos,sum)

Casos_Sex_Mun<- Casos_Sex_Mun %>% mutate(SEXO= case_when(SEXO == 1 ~ "Mujeres", SEXO == 2 ~ "Hombres", SEXO == 99 ~ "no especificado")) %>% arrange(desc(unos)) %>% group_by(SEXO) %>% top_n(10)
## Selecting by unos
textoss3<-paste("Municipio:",Casos_Sex_Mun$MUNICIPIO,"\n", "Número de defunciones de", Casos_Sex_Mun$SEXO, "por municipio:", Casos_Sex_Mun$unos)

bar_graf3<- Casos_Sex_Mun %>% ggplot(aes(x=Casos_Sex_Mun$unos, y=Casos_Sex_Mun$MUNICIPIO ,text=textoss3)) + theme_dark() + theme(text = element_text(size = 9), plot.title = element_text(hjust = 0.5),)+ geom_bar(stat = "identity", aes(fill=SEXO), position = "dodge") + labs(title = "Top 10 - Número de casos Covid por municipio y sexo", x = "Porcentaje", y = "Municipio") 

ggplotly(bar_graf3,tooltip = c("text"))

EJERCICIO 4

4. (15%) Gráfico de líneas que representa el número acumulado de defunciones a nivel estatal por día. Al desplazar el cursor sobre la línea, se debe de mostrar la cantidad representada en la línea.

Usando el acumulado de defunciones por día se realiza la gráfica de defunciones acumuladas a nivel estatal por día.

textoss<-paste("Fecha:",Acumulado_estatal_D$FECHA_DEF, "\n", "Número de defunciones acumuladas:", Acumulado_estatal_D$Acumulado )

Acumulado_estatal_D$FECHA_DEF<-as.Date(Acumulado_estatal_D$FECHA_DEF)

grafica_def_est_acu<- Acumulado_estatal_D %>% ggplot(aes(x=FECHA_DEF, y=Acumulado , text=textoss))+ theme_bw() +theme(text = element_text(size=10), plot.title = element_text(hjust = .5),) + geom_line() + geom_point(shape=.2) + labs(title = "Acumulado de defunciones por Covid a nivel estatal por día", x = "Fecha", y = "Acumulado de defunciones a nivel estatal por día")

ggplotly(grafica_def_est_acu, tooltip = c("text"))

EJERCICIO 5

5. (20%) Mapa que muestre la distribución 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 carga la base de datos del mapa en QGis para posteriormente por combinar datos de las defunciones y el total de casos de defunciones por municipio

mapa_guerrero<-readOGR("C:\\Users\\permi\\Desktop\\CIDE\\Primer semestre\\R\\Guerrero\\conjunto_de_datos",layer = "guerrero_mun")
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\Users\permi\Desktop\CIDE\Primer semestre\R\Guerrero\conjunto_de_datos", layer: "guerrero_mun"
## with 81 features
## It has 4 fields
mapa_guerrero$CVE_MUN<-as.numeric(mapa_guerrero$CVE_MUN)

Porcentaje_D<-merge(x=Porcentaje ,y=municipios_G , by.x="MUNICIPIO", by.y="MUNICIPIO")

Num_D<-merge(x=Def_X_Mun,y=municipios_G, by.x="MUNICIPIO", by.y="MUNICIPIO")

mapa_G3<-merge(x=Porcentaje_D , y=Num_D , by.x="MUNICIPIO", by.y="MUNICIPIO")

mapa_G<-merge(x=mapa_guerrero@data, y=mapa_G3 , by.x= "CVE_MUN", by.y="CLAVE_MUNICIPIO.x", sort = FALSE)

mapa_guerrero@data<-mapa_G

#levels(cut(as.numeric(mapa_guerrero@data$porcentaje.x),4))

cortess<- c(0,19.3,35.1,50.9,Inf)

colores <- colorBin( palette="Reds", domain=mapa_guerrero$porcentaje.x ,na.color="transparent", bins=cortess)

textoss <- paste(
      "Municipio : ",mapa_guerrero$Municipio.y ,"<br/>",
      "Porcentaje de defunciones por Covid: ", round(mapa_guerrero$porcentaje ,2),"<br/>","Total de casos de defunciones", mapa_guerrero$unos ,"<br/>" )  %>% lapply(htmltools::HTML)

leaflet(data=mapa_guerrero ) %>% 
 addTiles() %>% 
 addPolygons(label = textoss,fillColor = colores(mapa_guerrero$porcentaje), weight = 2, opacity = 1, color = "white", dashArray = "3",
                  fillOpacity = 0.9) %>% 
   addLegend("topleft", colors = c("#FEE5D9", "#FB9779", "#E74132", "#A50F15"),
             labels= c("(3.42%-19.3%)","(19.3%-35.1%)","(35.1%-50.9%)","(50.9%-66.7%)"),
             title= "Porcentaje de defunciones por municipio. ", opacity = 0.9)