En el corazón del Tidyverso
- readr (ya la estamos usando)
- dplyr (Clase anterior)
- tidyr (Hoy)
- forcats (Para variables categóricas)
- stringr (Para carácteres, Palabras)
- ggplot2 (Próxima clase)
- purrr (En clase sobre loops)
25/08, 2020
En el corazón del Tidyverso
Dos funciones
Contagiados <- read_csv("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto19/CasosActivosPorComuna.csv")
Region | Codigo region | Comuna | Codigo comuna | Poblacion | 2020-04-13 | 2020-04-15 | 2020-04-17 | 2020-04-20 | 2020-04-24 | 2020-04-27 | 2020-05-01 | 2020-05-04 | 2020-05-08 | 2020-05-11 | 2020-05-15 | 2020-05-18 | 2020-05-22 | 2020-05-25 | 2020-05-29 | 2020-06-01 | 2020-06-05 | 2020-06-08 | 2020-06-12 | 2020-06-15 | 2020-06-19 | 2020-06-23 | 2020-06-28 | 2020-07-01 | 2020-07-05 | 2020-07-10 | 2020-07-13 | 2020-07-17 | 2020-07-20 | 2020-07-24 | 2020-07-27 | 2020-07-31 | 2020-08-03 | 2020-08-07 | 2020-08-10 | 2020-08-14 | 2020-08-17 | 2020-08-21 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 88 | 80 | 72 | 65 | 77 | 103 | 105 | 87 | 61 | 66 | 49 | 68 | 117 | 143 | 163 | 177 | 248 | 278 | 328 | 353 | 358 | 381 | 408 | 406 | 495 | 575 | 655 | 818 | 859 | 981 | 984 | 962 | 861 | 709 | 779 | 775 | 778 | 651 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 12 | 12 | 7 | 2 | 2 | 6 | 4 | 4 | 1 | 1 | 1 |
Arica y Parinacota | 15 | General Lagos | 15202 | 810 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 5 | 14 | 26 | 11 |
Arica y Parinacota | 15 | Putre | 15201 | 2515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 8 | 7 | 1 | 1 | 1 | 15 | 17 | 15 | 12 | 7 | 7 | 3 | 1 | 10 | 15 | 9 | 6 | 1 |
Arica y Parinacota | 15 | Desconocido Arica y Parinacota | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 3 | 3 | 4 | 4 | 6 | 8 | 7 | 12 | 10 | 13 | 7 |
Arica y Parinacota | 15 | Total | NA | 252110 | 88 | 80 | 72 | 65 | 77 | 103 | 105 | 87 | 61 | 66 | 49 | 68 | 117 | 143 | 163 | 177 | 248 | 279 | 330 | 356 | 366 | 388 | 410 | 407 | 496 | 591 | 681 | 848 | 886 | 1000 | 998 | 974 | 876 | 731 | 815 | 809 | 824 | 671 |
Tarapaca | 01 | Alto Hospicio | 01107 | 129999 | 8 | 8 | 7 | 15 | 19 | 27 | 38 | 78 | 93 | 94 | 118 | 183 | 246 | 253 | 252 | 297 | 265 | 301 | 235 | 247 | 243 | 239 | 218 | 219 | 205 | 165 | 137 | 119 | 144 | 129 | 128 | 180 | 190 | 195 | 203 | 201 | 222 | 220 |
Tarapaca | 01 | Camina | 01402 | 1375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 3 | 7 | 7 | 4 | 3 | 1 | 1 | 8 | 10 | 13 | 7 | 6 | 3 | 7 | 3 | 1 | 3 | 3 | 2 | 2 | 8 | 12 | 13 |
Tarapaca | 01 | Colchane | 01403 | 1583 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 3 | 3 | 8 | 12 | 14 | 27 | 24 | 20 | 15 | 16 | 15 | 13 | 4 | 9 | 12 | 12 | 11 | 3 | 2 | 1 | 2 | 1 |
Tarapaca | 01 | Huara | 01404 | 3000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 6 | 7 | 7 | 5 | 7 | 6 | 11 | 9 | 6 | 8 | 5 | 5 | 10 | 12 | 9 | 9 | 15 | 21 | 28 | 28 | 27 | 21 | 18 | 13 | 9 | 6 | 3 | 11 | 12 | 9 |
Tarapaca | 01 | Iquique | 01101 | 223463 | 11 | 8 | 10 | 10 | 29 | 38 | 39 | 63 | 169 | 206 | 293 | 371 | 419 | 469 | 514 | 532 | 509 | 521 | 474 | 547 | 575 | 548 | 495 | 417 | 455 | 433 | 409 | 344 | 335 | 344 | 399 | 483 | 433 | 380 | 374 | 387 | 373 | 353 |
Tarapaca | 01 | Pica | 01405 | 5958 | 9 | 17 | 21 | 17 | 13 | 9 | 0 | 0 | 3 | 4 | 4 | 4 | 1 | 2 | 7 | 12 | 15 | 14 | 8 | 14 | 15 | 18 | 17 | 14 | 29 | 71 | 69 | 57 | 39 | 23 | 26 | 46 | 48 | 41 | 33 | 40 | 53 | 61 |
Tarapaca | 01 | Pozo Almonte | 01401 | 17395 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 3 | 4 | 13 | 19 | 30 | 46 | 44 | 56 | 97 | 115 | 130 | 106 | 64 | 65 | 55 | 66 | 83 | 55 | 53 | 47 | 53 | 140 | 143 | 145 | 82 | 78 | 81 | 73 |
Tarapaca | 01 | Desconocido Tarapaca | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | 44 | 40 | 36 | 39 | 40 | 35 | 39 | 38 | 72 | 60 | 68 | 59 | 49 | 62 | 30 | 27 | 29 | 24 |
Tarapaca | 01 | Total | NA | 382773 | 30 | 35 | 38 | 42 | 61 | 74 | 77 | 145 | 273 | 314 | 425 | 567 | 686 | 749 | 817 | 900 | 849 | 910 | 831 | 943 | 1032 | 991 | 871 | 793 | 827 | 814 | 786 | 657 | 681 | 636 | 705 | 936 | 886 | 834 | 729 | 753 | 784 | 754 |
Antofagasta | 02 | Antofagasta | 02101 | 425725 | 49 | 54 | 62 | 86 | 121 | 140 | 158 | 201 | 235 | 225 | 296 | 315 | 296 | 280 | 239 | 271 | 251 | 307 | 349 | 433 | 526 | 646 | 780 | 759 | 905 | 992 | 1065 | 966 | 825 | 751 | 680 | 654 | 689 | 747 | 890 | 817 | 754 | 661 |
Antofagasta | 02 | Calama | 02201 | 190336 | 12 | 11 | 10 | 10 | 9 | 25 | 33 | 37 | 32 | 33 | 57 | 76 | 76 | 87 | 98 | 55 | 73 | 92 | 221 | 370 | 746 | 978 | 923 | 876 | 814 | 743 | 726 | 585 | 494 | 399 | 413 | 375 | 313 | 298 | 272 | 295 | 277 | 220 |
Antofagasta | 02 | Maria Elena | 02302 | 6814 | 1 | 2 | 4 | 6 | 7 | 8 | 24 | 24 | 25 | 21 | 31 | 28 | 25 | 29 | 17 | 11 | 5 | 8 | 6 | 6 | 15 | 21 | 32 | 38 | 30 | 27 | 27 | 17 | 13 | 15 | 12 | 15 | 18 | 12 | 8 | 7 | 8 | 5 |
Antofagasta | 02 | Mejillones | 02102 | 14776 | 11 | 13 | 14 | 18 | 30 | 38 | 37 | 83 | 79 | 75 | 41 | 43 | 45 | 33 | 17 | 12 | 14 | 13 | 1 | 5 | 6 | 22 | 34 | 44 | 61 | 39 | 28 | 29 | 21 | 18 | 24 | 19 | 26 | 29 | 31 | 29 | 23 | 24 |
Antofagasta | 02 | Ollague | 02202 | 287 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 4 | 1 | 2 | 5 | 4 | 7 | 10 | 7 | 5 | 0 | 0 | 3 | 3 | 3 | 0 | 0 |
Antofagasta | 02 | San Pedro de Atacama | 02203 | 10434 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 4 | 3 | 1 | 1 | 2 | 12 | 20 | 29 | 35 | 42 | 40 | 34 | 39 | 44 | 55 | 52 | 37 | 30 | 35 | 26 | 32 | 25 | 25 | 19 |
Antofagasta | 02 | Sierra Gorda | 02103 | 1746 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 5 | 5 | 4 | 4 | 0 | 1 | 0 | 5 | 7 | 7 | 7 | 5 | 2 | 4 | 4 | 6 | 6 | 6 | 9 | 4 | 10 | 7 | 8 | 4 | 6 | 7 | 3 | 3 |
Antofagasta | 02 | Taltal | 02104 | 13657 | 3 | 5 | 5 | 5 | 4 | 0 | 0 | 1 | 1 | 1 | 8 | 7 | 12 | 12 | 4 | 8 | 8 | 7 | 6 | 4 | 10 | 15 | 10 | 11 | 11 | 15 | 22 | 27 | 27 | 17 | 16 | 6 | 7 | 16 | 16 | 17 | 11 | 20 |
Antofagasta | 02 | Tocopilla | 02301 | 28079 | 1 | 3 | 8 | 4 | 1 | 0 | 1 | 2 | 2 | 3 | 6 | 8 | 6 | 6 | 5 | 2 | 3 | 3 | 5 | 7 | 15 | 28 | 42 | 41 | 74 | 58 | 49 | 36 | 25 | 16 | 22 | 17 | 8 | 11 | 12 | 9 | 13 | 12 |
Antofagasta | 02 | Desconocido Antofagasta | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | 50 | 103 | 63 | 56 | 78 | 56 | 57 | 61 | 67 | 60 | 46 | 45 | 47 | 41 | 36 | 41 | 41 | 35 |
Antofagasta | 02 | Total | NA | 691854 | 78 | 88 | 103 | 129 | 172 | 211 | 253 | 348 | 376 | 360 | 444 | 482 | 465 | 452 | 384 | 363 | 355 | 436 | 597 | 846 | 1397 | 1849 | 1925 | 1872 | 2019 | 1975 | 2023 | 1778 | 1546 | 1339 | 1265 | 1168 | 1151 | 1187 | 1306 | 1250 | 1155 | 999 |
Atacama | 03 | Alto del Carmen | 03302 | 5729 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 1 | 2 | 3 | 2 | 1 | 0 | 1 | 1 | 2 | 2 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 5 | 18 | 20 |
Atacama | 03 | Caldera | 03102 | 19426 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 3 | 3 | 3 | 3 | 1 | 2 | 2 | 4 | 4 | 4 | 5 | 7 | 7 | 8 | 19 | 23 | 13 | 13 | 11 | 15 | 22 | 24 | 21 | 19 | 25 | 39 | 62 | 77 | 58 |
Atacama | 03 | Chanaral | 03201 | 13164 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 2 | 2 | 4 | 15 | 12 | 7 | 3 | 3 | 6 | 13 | 9 | 5 | 9 | 11 | 9 | 7 | 12 | 19 | 18 | 17 |
Atacama | 03 | Copiapo | 03101 | 171766 | 5 | 5 | 5 | 4 | 0 | 0 | 11 | 26 | 32 | 43 | 36 | 33 | 34 | 25 | 32 | 46 | 55 | 89 | 111 | 120 | 158 | 158 | 196 | 201 | 213 | 213 | 275 | 240 | 264 | 309 | 419 | 581 | 673 | 685 | 841 | 787 | 735 | 515 |
Atacama | 03 | Diego de Almagro | 03202 | 14358 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 1 | 1 | 2 | 5 | 8 | 5 | 4 | 2 | 3 | 7 | 13 | 6 | 7 | 7 | 5 | 14 | 14 | 10 | 4 | 2 | 3 | 3 | 2 | 4 | 4 | 12 | 31 | 51 |
Atacama | 03 | Freirina | 03303 | 7681 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 3 | 5 | 12 | 8 | 14 | 19 | 17 | 28 | 23 | 16 | 4 | 10 | 8 | 10 | 15 | 27 | 35 | 35 |
Atacama | 03 | Huasco | 03304 | 11264 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 4 | 7 | 6 | 4 | 6 | 5 | 5 | 5 | 5 | 3 | 2 | 1 | 1 | 4 | 6 | 7 | 6 | 3 | 2 | 8 | 11 |
Atacama | 03 | Tierra Amarilla | 03103 | 14312 | 4 | 4 | 4 | 2 | 0 | 1 | 2 | 4 | 2 | 12 | 13 | 10 | 5 | 0 | 1 | 1 | 2 | 3 | 6 | 10 | 12 | 21 | 17 | 13 | 8 | 17 | 33 | 28 | 32 | 25 | 41 | 47 | 62 | 63 | 71 | 59 | 59 | 46 |
Atacama | 03 | Vallenar | 03301 | 57009 | 0 | 0 | 0 | 0 | 7 | 12 | 12 | 14 | 13 | 19 | 15 | 13 | 5 | 5 | 5 | 10 | 16 | 27 | 27 | 33 | 51 | 76 | 80 | 97 | 93 | 103 | 107 | 72 | 74 | 63 | 48 | 40 | 47 | 33 | 49 | 44 | 68 | 74 |
Atacama | 03 | Desconocido Atacama | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | 4 | 3 | 9 | 25 | 4 | 3 | 2 | 2 | 2 | 2 | 2 | 4 | 2 | 1 | 0 | 1 | 13 | 3 |
Atacama | 03 | Total | NA | 314709 | 9 | 9 | 9 | 7 | 7 | 14 | 26 | 47 | 50 | 80 | 68 | 60 | 49 | 36 | 49 | 65 | 84 | 131 | 162 | 186 | 259 | 299 | 347 | 382 | 369 | 391 | 472 | 408 | 425 | 445 | 555 | 724 | 829 | 834 | 1034 | 1018 | 1062 | 830 |
Coquimbo | 04 | Andacollo | 04103 | 11791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 3 | 2 | 1 | 1 | 0 | 0 | 1 | 1 | 3 | 4 | 6 | 2 | 0 | 4 | 10 | 8 | 8 | 3 | 2 | 1 | 5 | 4 | 4 | 2 | 2 | 6 | 6 | 6 | 6 | 11 |
Coquimbo | 04 | Canela | 04202 | 9546 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 2 | 2 | 1 | 0 | 5 | 7 | 8 | 6 | 4 | 2 | 0 | 2 | 5 | 2 | 2 | 3 | 2 | 9 | 14 | 20 |
Coquimbo | 04 | Combarbala | 04302 | 13884 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 3 | 3 | 3 | 1 | 3 | 3 | 8 | 4 | 1 | 8 | 10 | 7 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 0 | 1 | 2 | 4 | 4 | 2 | 3 | 9 |
Coquimbo | 04 | Coquimbo | 04102 | 256735 | 1 | 2 | 0 | 2 | 3 | 4 | 6 | 8 | 9 | 11 | 14 | 17 | 11 | 9 | 17 | 16 | 55 | 95 | 102 | 127 | 177 | 190 | 235 | 223 | 248 | 278 | 310 | 325 | 357 | 377 | 434 | 432 | 414 | 389 | 435 | 419 | 417 | 418 |
Coquimbo | 04 | Illapel | 04201 | 32801 | 13 | 12 | 10 | 7 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 2 | 5 | 8 | 20 | 20 | 10 | 21 | 27 | 25 | 42 | 46 | 85 | 69 | 53 | 57 | 22 | 10 | 28 | 33 | 39 | 43 | 28 | 20 | 27 |
Coquimbo | 04 | La Higuera | 04104 | 4450 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 2 | 2 | 2 | 2 | 1 | 0 | 2 | 7 | 5 | 6 | 10 | 21 | 28 | 23 | 19 | 21 | 28 | 26 | 16 | 6 |
Coquimbo | 04 | La Serena | 04101 | 249656 | 2 | 1 | 1 | 2 | 4 | 5 | 3 | 9 | 12 | 17 | 26 | 28 | 41 | 35 | 38 | 60 | 44 | 66 | 93 | 116 | 175 | 196 | 238 | 198 | 242 | 281 | 281 | 344 | 377 | 329 | 366 | 398 | 413 | 405 | 427 | 381 | 308 | 268 |
Coquimbo | 04 | Los Vilos | 04203 | 23374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 3 | 4 | 7 | 8 | 17 | 27 | 28 | 18 | 11 | 9 | 6 | 6 | 23 | 26 | 22 | 23 | 14 | 29 | 31 | 29 |
Coquimbo | 04 | Monte Patria | 04303 | 32527 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 3 | 13 | 13 | 9 | 20 | 17 | 14 | 17 | 24 | 40 | 46 | 33 | 36 | 37 | 32 | 28 | 22 | 24 | 23 | 16 | 12 | 17 | 21 | 24 | 29 | 36 | 40 |
Coquimbo | 04 | Ovalle | 04301 | 121269 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 5 | 13 | 20 | 27 | 24 | 23 | 26 | 50 | 55 | 101 | 108 | 125 | 203 | 201 | 180 | 160 | 144 | 108 | 122 | 93 | 85 | 79 | 63 | 87 | 89 | 115 | 131 | 167 | 248 | 237 |
Coquimbo | 04 | Paiguano | 04105 | 4675 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 3 | 2 | 0 | 1 | 4 | 2 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 1 | 0 | 2 | 2 | 2 | 1 | 0 | 0 | 0 |
Coquimbo | 04 | Punitaqui | 04304 | 12165 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 2 | 4 | 6 | 5 | 1 | 0 | 0 | 2 | 3 | 5 | 11 | 10 | 3 | 7 | 7 | 9 | 10 | 7 | 11 | 12 | 10 | 18 | 18 | 17 | 9 | 5 | 5 | 5 | 15 | 15 | 21 |
Coquimbo | 04 | Rio Hurtado | 04305 | 4372 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 4 | 5 | 6 | 5 | 3 | 1 | 0 | 0 | 2 | 5 | 4 | 2 | 1 | 2 | 3 | 4 | 3 | 2 | 3 | 5 | 10 | 6 |
Entendamos la función
library(tidyverse) DF_largo <- Contagiados %>% pivot_longer(starts_with("2020"), names_to = "Fecha", values_to = "Infectados")
Region | Codigo region | Comuna | Codigo comuna | Poblacion | Fecha | Infectados |
---|---|---|---|---|---|---|
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-13 | 88 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-15 | 80 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-17 | 72 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-20 | 65 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-24 | 77 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-27 | 103 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-01 | 105 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-04 | 87 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-08 | 61 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-11 | 66 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-15 | 49 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-18 | 68 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-22 | 117 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-25 | 143 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-29 | 163 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-01 | 177 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-05 | 248 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-08 | 278 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-12 | 328 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-15 | 353 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-19 | 358 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-23 | 381 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-28 | 408 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-01 | 406 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-05 | 495 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-10 | 575 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-13 | 655 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-17 | 818 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-20 | 859 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-24 | 981 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-27 | 984 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-31 | 962 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-03 | 861 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-07 | 709 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-10 | 779 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-14 | 775 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-17 | 778 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-21 | 651 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-13 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-15 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-17 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-20 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-24 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-27 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-01 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-04 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-08 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-11 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-15 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-18 | 0 |
DF_largo <- DF_largo %>% mutate(Fecha = lubridate::ymd(Fecha))
Region | Codigo region | Comuna | Codigo comuna | Poblacion | Fecha | Infectados |
---|---|---|---|---|---|---|
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-13 | 88 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-15 | 80 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-17 | 72 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-20 | 65 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-24 | 77 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-04-27 | 103 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-01 | 105 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-04 | 87 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-08 | 61 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-11 | 66 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-15 | 49 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-18 | 68 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-22 | 117 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-25 | 143 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-05-29 | 163 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-01 | 177 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-05 | 248 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-08 | 278 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-12 | 328 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-15 | 353 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-19 | 358 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-23 | 381 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-06-28 | 408 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-01 | 406 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-05 | 495 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-10 | 575 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-13 | 655 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-17 | 818 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-20 | 859 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-24 | 981 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-27 | 984 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-07-31 | 962 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-03 | 861 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-07 | 709 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-10 | 779 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-14 | 775 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-17 | 778 |
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-21 | 651 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-13 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-15 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-17 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-20 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-24 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-04-27 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-01 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-04 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-08 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-11 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-15 | 0 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-05-18 | 0 |
Reciente <- DF_largo %>% dplyr::filter(Fecha == max(Fecha)) %>% mutate(Prevalencia = 1e+05 * (Infectados/Poblacion))
Region | Codigo region | Comuna | Codigo comuna | Poblacion | Fecha | Infectados | Prevalencia |
---|---|---|---|---|---|---|---|
Arica y Parinacota | 15 | Arica | 15101 | 247552 | 2020-08-21 | 651 | 262.97505 |
Arica y Parinacota | 15 | Camarones | 15102 | 1233 | 2020-08-21 | 1 | 81.10300 |
Arica y Parinacota | 15 | General Lagos | 15202 | 810 | 2020-08-21 | 11 | 1358.02469 |
Arica y Parinacota | 15 | Putre | 15201 | 2515 | 2020-08-21 | 1 | 39.76143 |
Arica y Parinacota | 15 | Desconocido Arica y Parinacota | NA | NA | 2020-08-21 | 7 | NA |
Arica y Parinacota | 15 | Total | NA | 252110 | 2020-08-21 | 671 | 266.15366 |
Tarapaca | 01 | Alto Hospicio | 01107 | 129999 | 2020-08-21 | 220 | 169.23207 |
Tarapaca | 01 | Camina | 01402 | 1375 | 2020-08-21 | 13 | 945.45455 |
Tarapaca | 01 | Colchane | 01403 | 1583 | 2020-08-21 | 1 | 63.17119 |
Tarapaca | 01 | Huara | 01404 | 3000 | 2020-08-21 | 9 | 300.00000 |
Tarapaca | 01 | Iquique | 01101 | 223463 | 2020-08-21 | 353 | 157.96799 |
Tarapaca | 01 | Pica | 01405 | 5958 | 2020-08-21 | 61 | 1023.83350 |
Tarapaca | 01 | Pozo Almonte | 01401 | 17395 | 2020-08-21 | 73 | 419.66082 |
Tarapaca | 01 | Desconocido Tarapaca | NA | NA | 2020-08-21 | 24 | NA |
Tarapaca | 01 | Total | NA | 382773 | 2020-08-21 | 754 | 196.98359 |
Antofagasta | 02 | Antofagasta | 02101 | 425725 | 2020-08-21 | 661 | 155.26455 |
Antofagasta | 02 | Calama | 02201 | 190336 | 2020-08-21 | 220 | 115.58507 |
Antofagasta | 02 | Maria Elena | 02302 | 6814 | 2020-08-21 | 5 | 73.37834 |
Antofagasta | 02 | Mejillones | 02102 | 14776 | 2020-08-21 | 24 | 162.42556 |
Antofagasta | 02 | Ollague | 02202 | 287 | 2020-08-21 | 0 | 0.00000 |
Antofagasta | 02 | San Pedro de Atacama | 02203 | 10434 | 2020-08-21 | 19 | 182.09699 |
Antofagasta | 02 | Sierra Gorda | 02103 | 1746 | 2020-08-21 | 3 | 171.82131 |
Antofagasta | 02 | Taltal | 02104 | 13657 | 2020-08-21 | 20 | 146.44505 |
Antofagasta | 02 | Tocopilla | 02301 | 28079 | 2020-08-21 | 12 | 42.73656 |
Antofagasta | 02 | Desconocido Antofagasta | NA | NA | 2020-08-21 | 35 | NA |
Antofagasta | 02 | Total | NA | 691854 | 2020-08-21 | 999 | 144.39463 |
Atacama | 03 | Alto del Carmen | 03302 | 5729 | 2020-08-21 | 20 | 349.10106 |
Atacama | 03 | Caldera | 03102 | 19426 | 2020-08-21 | 58 | 298.56893 |
Atacama | 03 | Chanaral | 03201 | 13164 | 2020-08-21 | 17 | 129.14008 |
Atacama | 03 | Copiapo | 03101 | 171766 | 2020-08-21 | 515 | 299.82651 |
Atacama | 03 | Diego de Almagro | 03202 | 14358 | 2020-08-21 | 51 | 355.20267 |
Atacama | 03 | Freirina | 03303 | 7681 | 2020-08-21 | 35 | 455.66983 |
Atacama | 03 | Huasco | 03304 | 11264 | 2020-08-21 | 11 | 97.65625 |
Atacama | 03 | Tierra Amarilla | 03103 | 14312 | 2020-08-21 | 46 | 321.40861 |
Atacama | 03 | Vallenar | 03301 | 57009 | 2020-08-21 | 74 | 129.80407 |
Atacama | 03 | Desconocido Atacama | NA | NA | 2020-08-21 | 3 | NA |
Atacama | 03 | Total | NA | 314709 | 2020-08-21 | 830 | 263.73570 |
Coquimbo | 04 | Andacollo | 04103 | 11791 | 2020-08-21 | 11 | 93.29149 |
Coquimbo | 04 | Canela | 04202 | 9546 | 2020-08-21 | 20 | 209.51184 |
Coquimbo | 04 | Combarbala | 04302 | 13884 | 2020-08-21 | 9 | 64.82282 |
Coquimbo | 04 | Coquimbo | 04102 | 256735 | 2020-08-21 | 418 | 162.81380 |
Coquimbo | 04 | Illapel | 04201 | 32801 | 2020-08-21 | 27 | 82.31456 |
Coquimbo | 04 | La Higuera | 04104 | 4450 | 2020-08-21 | 6 | 134.83146 |
Coquimbo | 04 | La Serena | 04101 | 249656 | 2020-08-21 | 268 | 107.34771 |
Coquimbo | 04 | Los Vilos | 04203 | 23374 | 2020-08-21 | 29 | 124.06948 |
Coquimbo | 04 | Monte Patria | 04303 | 32527 | 2020-08-21 | 40 | 122.97476 |
Coquimbo | 04 | Ovalle | 04301 | 121269 | 2020-08-21 | 237 | 195.43329 |
Coquimbo | 04 | Paiguano | 04105 | 4675 | 2020-08-21 | 0 | 0.00000 |
Coquimbo | 04 | Punitaqui | 04304 | 12165 | 2020-08-21 | 21 | 172.62639 |
Coquimbo | 04 | Rio Hurtado | 04305 | 4372 | 2020-08-21 | 6 | 137.23696 |
data(fish_encounters) Tabla <- fish_encounters %>% pivot_wider(names_from = station, values_from = seen)
fish | Release | I80_1 | Lisbon | Rstr | Base_TD | BCE | BCW | BCE2 | BCW2 | MAE | MAW |
---|---|---|---|---|---|---|---|---|---|---|---|
4842 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4843 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4844 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4845 | 1 | 1 | 1 | 1 | 1 | NA | NA | NA | NA | NA | NA |
4847 | 1 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA | NA |
4848 | 1 | 1 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA |
4849 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA | NA | NA |
4850 | 1 | 1 | NA | 1 | 1 | 1 | 1 | NA | NA | NA | NA |
4851 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA | NA | NA |
4854 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA | NA | NA |
4855 | 1 | 1 | 1 | 1 | 1 | NA | NA | NA | NA | NA | NA |
4857 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | NA | NA |
4858 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4859 | 1 | 1 | 1 | 1 | 1 | NA | NA | NA | NA | NA | NA |
4861 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4862 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | NA | NA |
4863 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA | NA | NA |
4864 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA | NA | NA |
4865 | 1 | 1 | 1 | NA | NA | NA | NA | NA | NA | NA | NA |
Tabla <- fish_encounters %>% pivot_wider(names_from = station, values_from = seen, values_fill = 0)
fish | Release | I80_1 | Lisbon | Rstr | Base_TD | BCE | BCW | BCE2 | BCW2 | MAE | MAW |
---|---|---|---|---|---|---|---|---|---|---|---|
4842 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4843 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4844 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4845 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
4847 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4848 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4849 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4850 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
4851 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4854 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4855 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
4857 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
4858 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4859 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
4861 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
4862 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
4863 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4864 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4865 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
warpbreaks <- warpbreaks %>% dplyr::select(wool, tension, breaks) Wide <- warpbreaks %>% pivot_wider(names_from = wool, values_from = breaks, )
warpbreaks <- warpbreaks %>% dplyr::select(wool, tension, breaks) Wide <- warpbreaks %>% pivot_wider(names_from = wool, values_from = breaks, values_fn = mean)
tension | A | B |
---|---|---|
L | 44.55556 | 28.22222 |
M | 24.00000 | 28.77778 |
H | 24.55556 | 18.77778 |
Tres bases de datos
Episodes <- read_csv("https://raw.githubusercontent.com/derek-corcoran-barrios/The_office/master/The_Office_Episodes_per_Character.csv") words <- read_csv("https://raw.githubusercontent.com/derek-corcoran-barrios/The_office/master/The_office_Words.csv") stop_words <- read_csv("https://raw.githubusercontent.com/derek-corcoran-barrios/The_office/master/stop_words.csv")
Episodios_words <- full_join(Episodes, words)
speaker | n_episodes | season | episode | title | scene | word |
---|---|---|---|---|---|---|
Dwight | 183 | 1 | 1 | Pilot | 5 | shall |
Dwight | 183 | 1 | 1 | Pilot | 5 | i |
Dwight | 183 | 1 | 1 | Pilot | 5 | play |
Dwight | 183 | 1 | 1 | Pilot | 5 | for |
Dwight | 183 | 1 | 1 | Pilot | 5 | you |
Dwight | 183 | 1 | 1 | Pilot | 5 | pa |
Dwight | 183 | 1 | 1 | Pilot | 5 | rum |
Dwight | 183 | 1 | 1 | Pilot | 5 | pump |
Dwight | 183 | 1 | 1 | Pilot | 5 | um |
Dwight | 183 | 1 | 1 | Pilot | 5 | pum |
Dwight | 183 | 1 | 1 | Pilot | 5 | i |
Dwight | 183 | 1 | 1 | Pilot | 5 | have |
Dwight | 183 | 1 | 1 | Pilot | 5 | no |
Dwight | 183 | 1 | 1 | Pilot | 5 | gifts |
Dwight | 183 | 1 | 1 | Pilot | 5 | for |
Dwight | 183 | 1 | 1 | Pilot | 5 | you |
Dwight | 183 | 1 | 1 | Pilot | 5 | pa |
Dwight | 183 | 1 | 1 | Pilot | 5 | rum |
Dwight | 183 | 1 | 1 | Pilot | 5 | pump |
Dwight | 183 | 1 | 1 | Pilot | 5 | um |
Dwight | 183 | 1 | 1 | Pilot | 5 | pum |
Dwight | 183 | 1 | 1 | Pilot | 7 | whassup |
Dwight | 183 | 1 | 1 | Pilot | 7 | whassup |
Dwight | 183 | 1 | 1 | Pilot | 19 | what |
Dwight | 183 | 1 | 1 | Pilot | 19 | just |
Dwight | 183 | 1 | 1 | Pilot | 19 | clearing |
Dwight | 183 | 1 | 1 | Pilot | 19 | my |
Dwight | 183 | 1 | 1 | Pilot | 19 | desk |
Dwight | 183 | 1 | 1 | Pilot | 19 | i |
Dwight | 183 | 1 | 1 | Pilot | 19 | can’t |
Dwight | 183 | 1 | 1 | Pilot | 19 | concentrate |
Dwight | 183 | 1 | 1 | Pilot | 19 | it’s |
Dwight | 183 | 1 | 1 | Pilot | 19 | overlapping |
Dwight | 183 | 1 | 1 | Pilot | 19 | it’s |
Dwight | 183 | 1 | 1 | Pilot | 19 | all |
Dwight | 183 | 1 | 1 | Pilot | 19 | spilling |
Dwight | 183 | 1 | 1 | Pilot | 19 | over |
Dwight | 183 | 1 | 1 | Pilot | 19 | the |
Dwight | 183 | 1 | 1 | Pilot | 19 | edge |
Dwight | 183 | 1 | 1 | Pilot | 19 | one |
Dwight | 183 | 1 | 1 | Pilot | 19 | word |
Dwight | 183 | 1 | 1 | Pilot | 19 | two |
Dwight | 183 | 1 | 1 | Pilot | 19 | syllables |
Dwight | 183 | 1 | 1 | Pilot | 19 | demarcation |
Dwight | 183 | 1 | 1 | Pilot | 19 | you |
Dwight | 183 | 1 | 1 | Pilot | 19 | can’t |
Dwight | 183 | 1 | 1 | Pilot | 19 | do |
Dwight | 183 | 1 | 1 | Pilot | 19 | that |
Dwight | 183 | 1 | 1 | Pilot | 19 | safety |
Dwight | 183 | 1 | 1 | Pilot | 19 | violation |
Episodes_top_10 <- Episodes %>% slice_max(order_by = n_episodes, n = 10)
speaker | n_episodes |
---|---|
Dwight | 183 |
Jim | 182 |
Pam | 179 |
Kevin | 177 |
Angela | 169 |
Phyllis | 163 |
Stanley | 163 |
Oscar | 161 |
Andy | 141 |
Kelly | 137 |
Episodios_words_10 <- Episodes_top_10 %>% left_join(words)
Mas_Palabras <- Episodios_words_10 %>% group_by(word) %>% summarise(n = n()) %>% slice_max(order_by = n, n = 20)
word | n |
---|---|
i | 9999 |
you | 9355 |
the | 7106 |
to | 6449 |
a | 6238 |
and | 4167 |
it | 4082 |
that | 3710 |
is | 3439 |
of | 3014 |
this | 2613 |
in | 2590 |
what | 2574 |
no | 2564 |
my | 2269 |
me | 2224 |
just | 2176 |
i’m | 2150 |
have | 2081 |
it’s | 2017 |
Mas_Palabras <- Episodios_words_10 %>% anti_join(stop_words) %>% group_by(word) %>% summarise(n = n()) %>% slice_max(order_by = n, n = 20)
word | n |
---|---|
yeah | 1481 |
hey | 1061 |
michael | 1032 |
good | 880 |
dwight | 738 |
gonna | 719 |
jim | 667 |
uh | 620 |
time | 581 |
back | 542 |
pam | 500 |
great | 499 |
guys | 441 |
um | 441 |
make | 419 |
god | 403 |
people | 398 |
day | 381 |
thing | 378 |
work | 354 |
Mas_Palabras <- Episodios_words_10 %>% anti_join(stop_words) %>% group_by(word, speaker) %>% summarise(n = n()) %>% ungroup() %>% group_by(speaker) %>% slice_max(order_by = n, n = 10) %>% arrange(speaker, desc(n))
word | speaker | n |
---|---|---|
yeah | Andy | 252 |
hey | Andy | 149 |
gonna | Andy | 129 |
guys | Andy | 120 |
good | Andy | 117 |
time | Andy | 100 |
uh | Andy | 95 |
back | Andy | 87 |
dwight | Andy | 78 |
erin | Andy | 78 |
dwight | Angela | 77 |
kevin | Angela | 40 |
god | Angela | 38 |
good | Angela | 34 |
pam | Angela | 32 |
party | Angela | 31 |
michael | Angela | 28 |
stop | Angela | 28 |
yeah | Angela | 28 |
pum | Angela | 27 |
jim | Dwight | 288 |
michael | Dwight | 281 |
good | Dwight | 221 |
yeah | Dwight | 215 |
hey | Dwight | 211 |
gonna | Dwight | 153 |
time | Dwight | 141 |
make | Dwight | 122 |
uh | Dwight | 121 |
back | Dwight | 119 |
yeah | Jim | 381 |
hey | Jim | 309 |
dwight | Jim | 253 |
uh | Jim | 236 |
good | Jim | 226 |
gonna | Jim | 195 |
pam | Jim | 183 |
michael | Jim | 180 |
great | Jim | 144 |
back | Jim | 141 |
god | Kelly | 50 |
ryan | Kelly | 43 |
yeah | Kelly | 42 |
guys | Kelly | 31 |
gonna | Kelly | 26 |
michael | Kelly | 25 |
time | Kelly | 23 |
jim | Kelly | 21 |
love | Kelly | 18 |
baby | Kelly | 17 |
guess | Kelly | 17 |
thought | Kelly | 17 |
yeah | Kevin | 118 |
michael | Kevin | 70 |
hey | Kevin | 47 |
jim | Kevin | 39 |
pam | Kevin | 39 |
oscar | Kevin | 34 |
good | Kevin | 32 |
gonna | Kevin | 31 |
guys | Kevin | 31 |
man | Kevin | 28 |
michael | Oscar | 65 |
yeah | Oscar | 43 |
angela | Oscar | 38 |
hey | Oscar | 38 |
good | Oscar | 36 |
gay | Oscar | 33 |
kevin | Oscar | 33 |
andy | Oscar | 29 |
guys | Oscar | 29 |
gonna | Oscar | 23 |
yeah | Pam | 337 |
michael | Pam | 256 |
hey | Pam | 249 |
jim | Pam | 180 |
um | Pam | 180 |
good | Pam | 150 |
dwight | Pam | 127 |
great | Pam | 120 |
gonna | Pam | 116 |
uh | Pam | 100 |
michael | Phyllis | 60 |
yeah | Phyllis | 57 |
dwight | Phyllis | 34 |
good | Phyllis | 34 |
andy | Phyllis | 26 |
time | Phyllis | 23 |
bob | Phyllis | 21 |
hey | Phyllis | 21 |
make | Phyllis | 17 |
party | Phyllis | 17 |
michael | Stanley | 27 |
work | Stanley | 19 |
day | Stanley | 15 |
good | Stanley | 15 |
mind | Stanley | 14 |
christmas | Stanley | 13 |
gonna | Stanley | 13 |
years | Stanley | 13 |
back | Stanley | 12 |
damn | Stanley | 11 |