library(tidyverse)
library(gt)

Usando los datos de COVID-19

library(data.table)
mydat<- read.csv('https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/owid-covid-data.csv')

#write.csv(mydat, "COVID19_world.csv")

gt(tail(mydat, n=4))
iso_code continent location date total_cases new_cases new_cases_smoothed total_deaths new_deaths new_deaths_smoothed total_cases_per_million new_cases_per_million new_cases_smoothed_per_million total_deaths_per_million new_deaths_per_million new_deaths_smoothed_per_million reproduction_rate icu_patients icu_patients_per_million hosp_patients hosp_patients_per_million weekly_icu_admissions weekly_icu_admissions_per_million weekly_hosp_admissions weekly_hosp_admissions_per_million total_tests new_tests total_tests_per_thousand new_tests_per_thousand new_tests_smoothed new_tests_smoothed_per_thousand positive_rate tests_per_case tests_units total_vaccinations people_vaccinated people_fully_vaccinated total_boosters new_vaccinations new_vaccinations_smoothed total_vaccinations_per_hundred people_vaccinated_per_hundred people_fully_vaccinated_per_hundred total_boosters_per_hundred new_vaccinations_smoothed_per_million new_people_vaccinated_smoothed new_people_vaccinated_smoothed_per_hundred stringency_index population_density median_age aged_65_older aged_70_older gdp_per_capita extreme_poverty cardiovasc_death_rate diabetes_prevalence female_smokers male_smokers handwashing_facilities hospital_beds_per_thousand life_expectancy human_development_index population excess_mortality_cumulative_absolute excess_mortality_cumulative excess_mortality excess_mortality_cumulative_per_million
ZWE Africa Zimbabwe 2024-03-28 266359 0 0 5740 0 0 16320.48 0 0 351.704 0 0 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 42.729 19.6 2.822 1.882 1899.775 21.4 307.846 1.82 1.6 30.7 36.791 1.7 61.49 0.571 16320539 NA NA NA NA
ZWE Africa Zimbabwe 2024-03-29 266359 0 0 5740 0 0 16320.48 0 0 351.704 0 0 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 42.729 19.6 2.822 1.882 1899.775 21.4 307.846 1.82 1.6 30.7 36.791 1.7 61.49 0.571 16320539 NA NA NA NA
ZWE Africa Zimbabwe 2024-03-30 266359 0 0 5740 0 0 16320.48 0 0 351.704 0 0 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 42.729 19.6 2.822 1.882 1899.775 21.4 307.846 1.82 1.6 30.7 36.791 1.7 61.49 0.571 16320539 NA NA NA NA
ZWE Africa Zimbabwe 2024-03-31 266359 0 0 5740 0 0 16320.48 0 0 351.704 0 0 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 42.729 19.6 2.822 1.882 1899.775 21.4 307.846 1.82 1.6 30.7 36.791 1.7 61.49 0.571 16320539 NA NA NA NA

Cual son los paises incluido en esta archivo

unique(mydat$location)
##   [1] "Afghanistan"                      "Africa"                          
##   [3] "Albania"                          "Algeria"                         
##   [5] "American Samoa"                   "Andorra"                         
##   [7] "Angola"                           "Anguilla"                        
##   [9] "Antigua and Barbuda"              "Argentina"                       
##  [11] "Armenia"                          "Aruba"                           
##  [13] "Asia"                             "Australia"                       
##  [15] "Austria"                          "Azerbaijan"                      
##  [17] "Bahamas"                          "Bahrain"                         
##  [19] "Bangladesh"                       "Barbados"                        
##  [21] "Belarus"                          "Belgium"                         
##  [23] "Belize"                           "Benin"                           
##  [25] "Bermuda"                          "Bhutan"                          
##  [27] "Bolivia"                          "Bonaire Sint Eustatius and Saba" 
##  [29] "Bosnia and Herzegovina"           "Botswana"                        
##  [31] "Brazil"                           "British Virgin Islands"          
##  [33] "Brunei"                           "Bulgaria"                        
##  [35] "Burkina Faso"                     "Burundi"                         
##  [37] "Cambodia"                         "Cameroon"                        
##  [39] "Canada"                           "Cape Verde"                      
##  [41] "Cayman Islands"                   "Central African Republic"        
##  [43] "Chad"                             "Chile"                           
##  [45] "China"                            "Colombia"                        
##  [47] "Comoros"                          "Congo"                           
##  [49] "Cook Islands"                     "Costa Rica"                      
##  [51] "Cote d'Ivoire"                    "Croatia"                         
##  [53] "Cuba"                             "Curacao"                         
##  [55] "Cyprus"                           "Czechia"                         
##  [57] "Democratic Republic of Congo"     "Denmark"                         
##  [59] "Djibouti"                         "Dominica"                        
##  [61] "Dominican Republic"               "Ecuador"                         
##  [63] "Egypt"                            "El Salvador"                     
##  [65] "England"                          "Equatorial Guinea"               
##  [67] "Eritrea"                          "Estonia"                         
##  [69] "Eswatini"                         "Ethiopia"                        
##  [71] "Europe"                           "European Union"                  
##  [73] "Faeroe Islands"                   "Falkland Islands"                
##  [75] "Fiji"                             "Finland"                         
##  [77] "France"                           "French Guiana"                   
##  [79] "French Polynesia"                 "Gabon"                           
##  [81] "Gambia"                           "Georgia"                         
##  [83] "Germany"                          "Ghana"                           
##  [85] "Gibraltar"                        "Greece"                          
##  [87] "Greenland"                        "Grenada"                         
##  [89] "Guadeloupe"                       "Guam"                            
##  [91] "Guatemala"                        "Guernsey"                        
##  [93] "Guinea"                           "Guinea-Bissau"                   
##  [95] "Guyana"                           "Haiti"                           
##  [97] "High income"                      "Honduras"                        
##  [99] "Hong Kong"                        "Hungary"                         
## [101] "Iceland"                          "India"                           
## [103] "Indonesia"                        "Iran"                            
## [105] "Iraq"                             "Ireland"                         
## [107] "Isle of Man"                      "Israel"                          
## [109] "Italy"                            "Jamaica"                         
## [111] "Japan"                            "Jersey"                          
## [113] "Jordan"                           "Kazakhstan"                      
## [115] "Kenya"                            "Kiribati"                        
## [117] "Kosovo"                           "Kuwait"                          
## [119] "Kyrgyzstan"                       "Laos"                            
## [121] "Latvia"                           "Lebanon"                         
## [123] "Lesotho"                          "Liberia"                         
## [125] "Libya"                            "Liechtenstein"                   
## [127] "Lithuania"                        "Low income"                      
## [129] "Lower middle income"              "Luxembourg"                      
## [131] "Macao"                            "Madagascar"                      
## [133] "Malawi"                           "Malaysia"                        
## [135] "Maldives"                         "Mali"                            
## [137] "Malta"                            "Marshall Islands"                
## [139] "Martinique"                       "Mauritania"                      
## [141] "Mauritius"                        "Mayotte"                         
## [143] "Mexico"                           "Micronesia (country)"            
## [145] "Moldova"                          "Monaco"                          
## [147] "Mongolia"                         "Montenegro"                      
## [149] "Montserrat"                       "Morocco"                         
## [151] "Mozambique"                       "Myanmar"                         
## [153] "Namibia"                          "Nauru"                           
## [155] "Nepal"                            "Netherlands"                     
## [157] "New Caledonia"                    "New Zealand"                     
## [159] "Nicaragua"                        "Niger"                           
## [161] "Nigeria"                          "Niue"                            
## [163] "North America"                    "North Korea"                     
## [165] "North Macedonia"                  "Northern Cyprus"                 
## [167] "Northern Ireland"                 "Northern Mariana Islands"        
## [169] "Norway"                           "Oceania"                         
## [171] "Oman"                             "Pakistan"                        
## [173] "Palau"                            "Palestine"                       
## [175] "Panama"                           "Papua New Guinea"                
## [177] "Paraguay"                         "Peru"                            
## [179] "Philippines"                      "Pitcairn"                        
## [181] "Poland"                           "Portugal"                        
## [183] "Puerto Rico"                      "Qatar"                           
## [185] "Reunion"                          "Romania"                         
## [187] "Russia"                           "Rwanda"                          
## [189] "Saint Barthelemy"                 "Saint Helena"                    
## [191] "Saint Kitts and Nevis"            "Saint Lucia"                     
## [193] "Saint Martin (French part)"       "Saint Pierre and Miquelon"       
## [195] "Saint Vincent and the Grenadines" "Samoa"                           
## [197] "San Marino"                       "Sao Tome and Principe"           
## [199] "Saudi Arabia"                     "Scotland"                        
## [201] "Senegal"                          "Serbia"                          
## [203] "Seychelles"                       "Sierra Leone"                    
## [205] "Singapore"                        "Sint Maarten (Dutch part)"       
## [207] "Slovakia"                         "Slovenia"                        
## [209] "Solomon Islands"                  "Somalia"                         
## [211] "South Africa"                     "South America"                   
## [213] "South Korea"                      "South Sudan"                     
## [215] "Spain"                            "Sri Lanka"                       
## [217] "Sudan"                            "Suriname"                        
## [219] "Sweden"                           "Switzerland"                     
## [221] "Syria"                            "Taiwan"                          
## [223] "Tajikistan"                       "Tanzania"                        
## [225] "Thailand"                         "Timor"                           
## [227] "Togo"                             "Tokelau"                         
## [229] "Tonga"                            "Trinidad and Tobago"             
## [231] "Tunisia"                          "Turkey"                          
## [233] "Turkmenistan"                     "Turks and Caicos Islands"        
## [235] "Tuvalu"                           "Uganda"                          
## [237] "Ukraine"                          "United Arab Emirates"            
## [239] "United Kingdom"                   "United States"                   
## [241] "United States Virgin Islands"     "Upper middle income"             
## [243] "Uruguay"                          "Uzbekistan"                      
## [245] "Vanuatu"                          "Vatican"                         
## [247] "Venezuela"                        "Vietnam"                         
## [249] "Wales"                            "Wallis and Futuna"               
## [251] "Western Sahara"                   "World"                           
## [253] "Yemen"                            "Zambia"                          
## [255] "Zimbabwe"

Ejercicio 1

5 puntos

Seleccionar variables y filtrar

  • Selecciona las variables de “location”, “new_cases” y “total_death”
  • Filtrar para los datos de UN pais solamente.

Produzca un gráfico de Wilkinson

  • Selecciona un solapamiento de los datos para poder ver toso los puntos

Ejercicio 2

5 puntos

Seleccionar variables y filtrar

  • Selecciona las variables de “location”, “new_cases” y “total_death”
  • Filtrar para los datos de dos paises caribeño. Nota que no he enseñado como seleccionar más de un país, mira a ver si encuentra solución en el internet. Si no la encuentra, habla con colegas de la clase. Si todavía no lo encuentra comunicarse conmigo.

Produzca un gráfico de Wilkinson

  • Selecciona un solapamiento de los datos para poder ver toso los puntos y posiciona los datos de los dos países uno al lado del otro.

Bono

3 puntos

Selecciona cinco países pequeños del Caribe y reproduzca la gráfica anterior. Para que la gráfica se puede apreciar tendrán que usar los países con poblaciones más pequeño.

Someter los script y gráfico en un documento .html en MSTEAM