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-08-01 266386 0 0 5740 0 0 16577.57 0 0 357.21 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.73 19.6 2.82 1.88 1899.78 21.4 307.85 1.82 1.6 30.7 36.79 1.7 61.49 0.57 16320539 NA NA NA NA
ZWE Africa Zimbabwe 2024-08-02 266386 0 0 5740 0 0 16577.57 0 0 357.21 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.73 19.6 2.82 1.88 1899.78 21.4 307.85 1.82 1.6 30.7 36.79 1.7 61.49 0.57 16320539 NA NA NA NA
ZWE Africa Zimbabwe 2024-08-03 266386 0 0 5740 0 0 16577.57 0 0 357.21 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.73 19.6 2.82 1.88 1899.78 21.4 307.85 1.82 1.6 30.7 36.79 1.7 61.49 0.57 16320539 NA NA NA NA
ZWE Africa Zimbabwe 2024-08-04 266386 0 0 5740 0 0 16577.57 0 0 357.21 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.73 19.6 2.82 1.88 1899.78 21.4 307.85 1.82 1.6 30.7 36.79 1.7 61.49 0.57 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"               "East Timor"                      
##  [63] "Ecuador"                          "Egypt"                           
##  [65] "El Salvador"                      "England"                         
##  [67] "Equatorial Guinea"                "Eritrea"                         
##  [69] "Estonia"                          "Eswatini"                        
##  [71] "Ethiopia"                         "Europe"                          
##  [73] "European Union (27)"              "Faroe Islands"                   
##  [75] "Falkland Islands"                 "Fiji"                            
##  [77] "Finland"                          "France"                          
##  [79] "French Guiana"                    "French Polynesia"                
##  [81] "Gabon"                            "Gambia"                          
##  [83] "Georgia"                          "Germany"                         
##  [85] "Ghana"                            "Gibraltar"                       
##  [87] "Greece"                           "Greenland"                       
##  [89] "Grenada"                          "Guadeloupe"                      
##  [91] "Guam"                             "Guatemala"                       
##  [93] "Guernsey"                         "Guinea"                          
##  [95] "Guinea-Bissau"                    "Guyana"                          
##  [97] "Haiti"                            "High-income countries"           
##  [99] "Honduras"                         "Hong Kong"                       
## [101] "Hungary"                          "Iceland"                         
## [103] "India"                            "Indonesia"                       
## [105] "Iran"                             "Iraq"                            
## [107] "Ireland"                          "Isle of Man"                     
## [109] "Israel"                           "Italy"                           
## [111] "Jamaica"                          "Japan"                           
## [113] "Jersey"                           "Jordan"                          
## [115] "Kazakhstan"                       "Kenya"                           
## [117] "Kiribati"                         "Kosovo"                          
## [119] "Kuwait"                           "Kyrgyzstan"                      
## [121] "Laos"                             "Latvia"                          
## [123] "Lebanon"                          "Lesotho"                         
## [125] "Liberia"                          "Libya"                           
## [127] "Liechtenstein"                    "Lithuania"                       
## [129] "Low-income countries"             "Lower-middle-income countries"   
## [131] "Luxembourg"                       "Macao"                           
## [133] "Madagascar"                       "Malawi"                          
## [135] "Malaysia"                         "Maldives"                        
## [137] "Mali"                             "Malta"                           
## [139] "Marshall Islands"                 "Martinique"                      
## [141] "Mauritania"                       "Mauritius"                       
## [143] "Mayotte"                          "Mexico"                          
## [145] "Micronesia (country)"             "Moldova"                         
## [147] "Monaco"                           "Mongolia"                        
## [149] "Montenegro"                       "Montserrat"                      
## [151] "Morocco"                          "Mozambique"                      
## [153] "Myanmar"                          "Namibia"                         
## [155] "Nauru"                            "Nepal"                           
## [157] "Netherlands"                      "New Caledonia"                   
## [159] "New Zealand"                      "Nicaragua"                       
## [161] "Niger"                            "Nigeria"                         
## [163] "Niue"                             "North America"                   
## [165] "North Korea"                      "North Macedonia"                 
## [167] "Northern Cyprus"                  "Northern Ireland"                
## [169] "Northern Mariana Islands"         "Norway"                          
## [171] "Oceania"                          "Oman"                            
## [173] "Pakistan"                         "Palau"                           
## [175] "Palestine"                        "Panama"                          
## [177] "Papua New Guinea"                 "Paraguay"                        
## [179] "Peru"                             "Philippines"                     
## [181] "Pitcairn"                         "Poland"                          
## [183] "Portugal"                         "Puerto Rico"                     
## [185] "Qatar"                            "Reunion"                         
## [187] "Romania"                          "Russia"                          
## [189] "Rwanda"                           "Saint Barthelemy"                
## [191] "Saint Helena"                     "Saint Kitts and Nevis"           
## [193] "Saint Lucia"                      "Saint Martin (French part)"      
## [195] "Saint Pierre and Miquelon"        "Saint Vincent and the Grenadines"
## [197] "Samoa"                            "San Marino"                      
## [199] "Sao Tome and Principe"            "Saudi Arabia"                    
## [201] "Scotland"                         "Senegal"                         
## [203] "Serbia"                           "Seychelles"                      
## [205] "Sierra Leone"                     "Singapore"                       
## [207] "Sint Maarten (Dutch part)"        "Slovakia"                        
## [209] "Slovenia"                         "Solomon Islands"                 
## [211] "Somalia"                          "South Africa"                    
## [213] "South America"                    "South Korea"                     
## [215] "South Sudan"                      "Spain"                           
## [217] "Sri Lanka"                        "Sudan"                           
## [219] "Suriname"                         "Sweden"                          
## [221] "Switzerland"                      "Syria"                           
## [223] "Taiwan"                           "Tajikistan"                      
## [225] "Tanzania"                         "Thailand"                        
## [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 countries"   
## [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