library(httr)
## Warning: package 'httr' was built under R version 4.5.2
library(rvest)
## Warning: package 'rvest' was built under R version 4.5.2
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.1 ✔ stringr 1.5.2
## ✔ ggplot2 4.0.0 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.1.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ readr::guess_encoding() masks rvest::guess_encoding()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(knitr)
The aim is to explore COVID-19 testing and case data of different countries. and compare countries, identify patterns, such as confirmed cases related to the population.
i Get a subset of the extracted data frame.
ii Calculate worldwide COVID testing positive ratio.
iii Get a country list which reported their testing data.
iv Identify countries names with a specific pattern.
v Compare which one of the selected countries has a larger ratio of confirmed cases to population.
vi Find countries with confirmed cases to population ratio rate less than a threshold
#
get_wiki_covid19_page <- function() {
wiki_base_url <- "https://en.wikipedia.org/w/index.php"
url_param <- list(title = "Template:COVID-19_testing_by_country")
# - Use the `GET` function in httr library with a `url` argument and a `query` arugment to get a HTTP response
result <- GET(url = wiki_base_url, query = url_param)
# Use the `return` function to return the response
return(result)
}
# Call the get_wiki_covid19_page function and print the response
response <- get_wiki_covid19_page()
response
## Response [https://en.wikipedia.org/w/index.php?title=Template%3ACOVID-19_testing_by_country]
## Date: 2025-11-19 11:09
## Status: 200
## Content-Type: text/html; charset=UTF-8
## Size: 456 kB
## <!DOCTYPE html>
## <html class="client-nojs vector-feature-language-in-header-enabled vector-fea...
## <head>
## <meta charset="UTF-8">
## <title>Template:COVID-19 testing by country - Wikipedia</title>
## <script>(function(){var className="client-js vector-feature-language-in-heade...
## RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.st...
## <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return...
## }];});});</script>
## <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.cite.styles%...
## ...
root_node <- read_html(response)
root_node
## {html_document}
## <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-sticky-header-enabled vector-toc-available" lang="en" dir="ltr">
## [1] <head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8 ...
## [2] <body class="skin--responsive skin-vector skin-vector-search-vue mediawik ...
# Get the table node from the root html node
table_node <- html_nodes(root_node, "table")
table_node
## {xml_nodeset (4)}
## [1] <table class="box-Update plainlinks ombox ombox-content ambox-Update" rol ...
## [2] <table class="wikitable plainrowheaders sortable collapsible autocollapse ...
## [3] <table class="plainlinks ombox mbox-small ombox-notice" role="presentatio ...
## [4] <table class="wikitable mw-templatedata-doc-params">\n<caption><p class=" ...
#Read the table node from the root html node
Covid19 <- as.data.frame(html_table(table_node[2]))
Covid19
## Country.or.region
## 1 Afghanistan
## 2 Albania
## 3 Algeria
## 4 Andorra
## 5 Angola
## 6 Antigua and Barbuda
## 7 Argentina
## 8 Armenia
## 9 Australia
## 10 Austria
## 11 Azerbaijan
## 12 Bahamas
## 13 Bahrain
## 14 Bangladesh
## 15 Barbados
## 16 Belarus
## 17 Belgium
## 18 Belize
## 19 Benin
## 20 Bhutan
## 21 Bolivia
## 22 Bosnia and Herzegovina
## 23 Botswana
## 24 Brazil
## 25 Brunei
## 26 Bulgaria
## 27 Burkina Faso
## 28 Burundi
## 29 Cambodia
## 30 Cameroon
## 31 Canada
## 32 Chad
## 33 Chile
## 34 China[c]
## 35 Colombia
## 36 Costa Rica
## 37 Croatia
## 38 Cuba
## 39 Cyprus[d]
## 40 Czechia
## 41 Denmark[e]
## 42 Djibouti
## 43 Dominica
## 44 Dominican Republic
## 45 DR Congo
## 46 Ecuador
## 47 Egypt
## 48 El Salvador
## 49 Equatorial Guinea
## 50 Estonia
## 51 Eswatini
## 52 Ethiopia
## 53 Faroe Islands
## 54 Fiji
## 55 Finland
## 56 France[f][g]
## 57 Gabon
## 58 Gambia
## 59 Georgia[h]
## 60 Germany
## 61 Ghana
## 62 Greece
## 63 Greenland
## 64 Grenada
## 65 Guatemala
## 66 Guinea
## 67 Guinea-Bissau
## 68 Guyana
## 69 Haiti
## 70 Honduras
## 71 Hungary
## 72 Iceland
## 73 India
## 74 Indonesia
## 75 Iran
## 76 Iraq
## 77 Ireland
## 78 Israel
## 79 Italy
## 80 Ivory Coast
## 81 Jamaica
## 82 Japan
## 83 Jordan
## 84 Kazakhstan
## 85 Kenya
## 86 Kosovo
## 87 Kuwait
## 88 Kyrgyzstan
## 89 Laos
## 90 Latvia
## 91 Lebanon
## 92 Lesotho
## 93 Liberia
## 94 Libya
## 95 Lithuania
## 96 Luxembourg[i]
## 97 Madagascar
## 98 Malawi
## 99 Malaysia
## 100 Maldives
## 101 Mali
## 102 Malta
## 103 Mauritania
## 104 Mauritius
## 105 Mexico
## 106 Moldova[j]
## 107 Mongolia
## 108 Montenegro
## 109 Morocco
## 110 Mozambique
## 111 Myanmar
## 112 Namibia
## 113 Nepal
## 114 Netherlands
## 115 New Caledonia
## 116 New Zealand
## 117 Niger
## 118 Nigeria
## 119 North Korea
## 120 North Macedonia
## 121 Northern Cyprus[k]
## 122 Norway
## 123 Oman
## 124 Pakistan
## 125 Palestine
## 126 Panama
## 127 Papua New Guinea
## 128 Paraguay
## 129 Peru
## 130 Philippines
## 131 Poland
## 132 Portugal
## 133 Qatar
## 134 Romania
## 135 Russia
## 136 Rwanda
## 137 Saint Kitts and Nevis
## 138 Saint Lucia
## 139 Saint Vincent
## 140 San Marino
## 141 Saudi Arabia
## 142 Senegal
## 143 Serbia
## 144 Singapore
## 145 Slovakia
## 146 Slovenia
## 147 South Africa
## 148 South Korea
## 149 South Sudan
## 150 Spain
## 151 Sri Lanka
## 152 Sudan
## 153 Sweden
## 154 Switzerland[l]
## 155 Taiwan[m]
## 156 Tanzania
## 157 Thailand
## 158 Togo
## 159 Trinidad and Tobago
## 160 Tunisia
## 161 Turkey
## 162 Uganda
## 163 Ukraine
## 164 United Arab Emirates
## 165 United Kingdom
## 166 United States
## 167 Uruguay
## 168 Uzbekistan
## 169 Venezuela
## 170 Vietnam
## 171 Zambia
## 172 Zimbabwe
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Date.a.
## 1 17 Dec 2020
## 2 18 Feb 2021
## 3 2 Nov 2020
## 4 23 Feb 2022
## 5 2 Feb 2021
## 6 6 Mar 2021
## 7 16 Apr 2022
## 8 29 May 2022
## 9 9 Sep 2022
## 10 1 Feb 2023
## 11 11 May 2022
## 12 28 Nov 2022
## 13 3 Dec 2022
## 14 24 Jul 2021
## 15 14 Oct 2022
## 16 9 May 2022
## 17 24 Jan 2023
## 18 8 Jun 2022
## 19 4 May 2021
## 20 28 Feb 2022
## 21 5 Jun 2022
## 22 27 Sep 2022
## 23 11 Jan 2022
## 24 19 Feb 2021
## 25 2 Aug 2021
## 26 2 Feb 2023
## 27 4 Mar 2021
## 28 5 Jan 2021
## 29 1 Aug 2021
## 30 18 Feb 2021
## 31 26 Nov 2022
## 32 2 Mar 2021
## 33 1 Feb 2023
## 34 31 Jul 2020
## 35 24 Nov 2022
## 36 2 Nov 2021
## 37 2 Feb 2023
## 38 2 Feb 2023
## 39 29 Jan 2023
## 40 1 Feb 2023
## 41 31 Jan 2023
## 42 28 Apr 2022
## 43 20 Jun 2022
## 44 22 Jul 2022
## 45 28 Feb 2021
## 46 23 Jul 2021
## 47 23 Jul 2021
## 48 18 Mar 2022
## 49 30 Jan 2023
## 50 31 Jan 2023
## 51 8 Dec 2021
## 52 24 Jun 2021
## 53 27 Feb 2022
## 54 2 Jan 2023
## 55 14 Jan 2022
## 56 15 May 2022
## 57 23 Jul 2021
## 58 15 Feb 2021
## 59 3 Nov 2021
## 60 7 Jul 2021
## 61 3 Jul 2021
## 62 18 Dec 2022
## 63 30 Jan 2022
## 64 11 May 2021
## 65 6 Jan 2023
## 66 21 Jul 2021
## 67 7 Jul 2022
## 68 15 Jun 2022
## 69 26 Nov 2022
## 70 26 Nov 2021
## 71 10 May 2022
## 72 9 Aug 2022
## 73 8 Jul 2022
## 74 3 Jul 2023
## 75 31 May 2022
## 76 3 Aug 2022
## 77 31 Jan 2023
## 78 17 Jan 2022
## 79 16 Mar 2023
## 80 3 Mar 2021
## 81 30 Sep 2022
## 82 1 Mar 2021
## 83 6 Jun 2021
## 84 28 May 2021
## 85 5 Mar 2021
## 86 31 May 2021
## 87 9 Mar 2022
## 88 10 Feb 2021
## 89 1 Mar 2021
## 90 5 Sep 2021
## 91 14 Jun 2021
## 92 30 Mar 2022
## 93 17 Jul 2021
## 94 14 Apr 2022
## 95 31 Jan 2023
## 96 12 May 2022
## 97 19 Feb 2021
## 98 29 Nov 2022
## 99 7 Sep 2021
## 100 13 Mar 2022
## 101 7 Jul 2021
## 102 8 Sep 2021
## 103 16 Apr 2021
## 104 22 Nov 2020
## 105 15 Oct 2021
## 106 20 Apr 2022
## 107 10 Jul 2021
## 108 10 May 2021
## 109 6 Jan 2023
## 110 22 Jul 2021
## 111 16 Sep 2021
## 112 4 Jul 2022
## 113 26 Jul 2022
## 114 6 Jul 2021
## 115 3 Sep 2021
## 116 29 Jan 2023
## 117 22 Feb 2021
## 118 28 Feb 2021
## 119 25 Nov 2020
## 120 1 Jul 2021
## 121 12 Jul 2022
## 122 20 Jan 2022
## 123 28 Oct 2020
## 124 5 Mar 2021
## 125 5 Feb 2022
## 126 28 Jan 2023
## 127 17 Feb 2021
## 128 27 Mar 2022
## 129 17 Nov 2022
## 130 7 Jan 2023
## 131 27 Apr 2022
## 132 5 Jan 2022
## 133 11 Nov 2022
## 134 29 Jan 2021
## 135 6 Jun 2022
## 136 6 Oct 2021
## 137 26 Aug 2021
## 138 7 Oct 2022
## 139 28 Jan 2023
## 140 29 Jan 2023
## 141 26 Apr 2022
## 142 12 Jul 2021
## 143 2 Feb 2023
## 144 3 Aug 2021
## 145 2 Feb 2023
## 146 2 Feb 2023
## 147 24 May 2021
## 148 1 Mar 2021
## 149 26 May 2021
## 150 1 Jul 2021
## 151 30 Mar 2021
## 152 7 Jan 2021
## 153 24 May 2021
## 154 7 Nov 2022
## 155 3 Feb 2023
## 156 18 Nov 2020
## 157 4 Mar 2021
## 158 6 Jan 2023
## 159 3 Jan 2022
## 160 23 Aug 2021
## 161 2 Jul 2021
## 162 11 Feb 2021
## 163 24 Nov 2021
## 164 1 Feb 2023
## 165 19 May 2022
## 166 29 Jul 2022
## 167 16 Apr 2022
## 168 7 Sep 2020
## 169 30 Mar 2021
## 170 28 Aug 2022
## 171 10 Mar 2022
## 172 15 Oct 2022
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Tested
## 1 154,767
## 2 428,654
## 3 230,553
## 4 300,307
## 5 399,228
## 6 15,268
## 7 35,716,069
## 8 3,099,602
## 9 78,548,492
## 10 205,817,752
## 11 6,838,458
## 12 259,366
## 13 10,578,766
## 14 7,417,714
## 15 770,100
## 16 13,217,569
## 17 36,548,544
## 18 572,900
## 19 595,112
## 20 1,736,168
## 21 4,358,669
## 22 1,872,934
## 23 2,026,898
## 24 23,561,497
## 25 153,804
## 26 10,993,239
## 27 158,777
## 28 90,019
## 29 1,812,706
## 30 942,685
## 31 66,343,123
## 32 99,027
## 33 48,154,268
## 34 160,000,000
## 35 36,875,818
## 36 2,575,363
## 37 5,481,285
## 38 14,301,394
## 39 27,820,163
## 40 22,544,928
## 41 67,682,707
## 42 305,941
## 43 209,803
## 44 3,574,665
## 45 124,838
## 46 1,627,189
## 47 3,137,519
## 48 1,847,861
## 49 403,773
## 50 3,637,908
## 51 415,110
## 52 2,981,185
## 53 774,000
## 54 667,953
## 55 9,042,453
## 56 272,417,258
## 57 958,807
## 58 43,217
## 59 4,888,787
## 60 65,247,345
## 61 1,305,749
## 62 101,576,831
## 63 164,573
## 64 28,684
## 65 6,800,560
## 66 494,898
## 67 145,231
## 68 648,569
## 69 223,475
## 70 1,133,782
## 71 11,394,556
## 72 1,988,652
## 73 866,177,937
## 74 76,062,770
## 75 52,269,202
## 76 19,090,652
## 77 12,990,476
## 78 41,373,364
## 79 269,127,054
## 80 429,177
## 81 1,184,973
## 82 8,487,288
## 83 7,407,053
## 84 11,575,012
## 85 1,322,806
## 86 611,357
## 87 7,754,247
## 88 695,415
## 89 114,030
## 90 3,630,095
## 91 4,599,186
## 92 431,221
## 93 128,246
## 94 2,578,215
## 95 9,046,584
## 96 4,248,188
## 97 119,608
## 98 624,784
## 99 23,705,425
## 100 2,216,560
## 101 322,504
## 102 1,211,456
## 103 268,093
## 104 289,552
## 105 10,503,678
## 106 3,213,594
## 107 3,354,200
## 108 394,388
## 109 14,217,563
## 110 688,570
## 111 4,047,680
## 112 1,062,663
## 113 5,804,358
## 114 14,526,293
## 115 41,962
## 116 7,757,935
## 117 79,321
## 118 1,544,008
## 119 16,914
## 120 881,870
## 121 7,096,998
## 122 9,811,888
## 123 509,959
## 124 9,173,593
## 125 3,078,533
## 126 7,475,016
## 127 47,490
## 128 2,609,819
## 129 36,073,768
## 130 34,402,980
## 131 36,064,311
## 132 27,515,490
## 133 4,061,988
## 134 5,405,393
## 135 295,542,733
## 136 2,885,812
## 137 30,231
## 138 212,132
## 139 113,504
## 140 192,613
## 141 41,849,069
## 142 624,502
## 143 12,185,475
## 144 16,206,203
## 145 7,391,882
## 146 2,826,117
## 147 11,378,282
## 148 6,592,010
## 149 164,472
## 150 54,128,524
## 151 2,384,745
## 152 158,804
## 153 9,996,795
## 154 23,283,909
## 155 30,275,725
## 156 3,880
## 157 1,579,597
## 158 807,269
## 159 512,730
## 160 2,893,625
## 161 61,236,294
## 162 852,444
## 163 15,648,456
## 164 198,685,717
## 165 522,526,476
## 166 929,349,291
## 167 6,089,116
## 168 2,630,000
## 169 3,179,074
## 170 45,772,571
## 171 3,301,860
## 172 2,529,087
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Units.b.
## 1 samples
## 2 samples
## 3 samples
## 4 samples
## 5 samples
## 6 samples
## 7 samples
## 8 samples
## 9 samples
## 10 samples
## 11 samples
## 12 samples
## 13 samples
## 14 samples
## 15 samples
## 16 samples
## 17 samples
## 18 samples
## 19 samples
## 20 samples
## 21 cases
## 22 samples
## 23
## 24 samples
## 25 samples
## 26 samples
## 27 samples
## 28
## 29
## 30 samples
## 31 samples
## 32 samples
## 33 samples
## 34 cases
## 35 samples
## 36 samples
## 37 cases
## 38 samples
## 39 samples
## 40 samples
## 41 samples
## 42
## 43 cases
## 44 samples
## 45
## 46 samples
## 47 samples
## 48 samples
## 49
## 50 samples
## 51
## 52 samples
## 53 samples
## 54 samples
## 55 samples
## 56 samples
## 57 samples
## 58 samples
## 59 samples
## 60 samples
## 61 samples
## 62 samples
## 63 samples
## 64
## 65 samples
## 66 samples
## 67
## 68 cases
## 69 cases
## 70 samples
## 71 samples
## 72 samples
## 73 samples
## 74 cases
## 75 samples
## 76 samples
## 77 samples
## 78 samples
## 79 samples
## 80 samples
## 81 samples
## 82
## 83 samples
## 84 samples
## 85 samples
## 86 cases
## 87 samples
## 88 samples
## 89 cases
## 90 samples
## 91 samples
## 92
## 93
## 94 samples
## 95 samples
## 96 samples
## 97 cases
## 98 samples
## 99 cases
## 100 samples
## 101 samples
## 102 samples
## 103
## 104 samples
## 105 cases
## 106 samples
## 107 cases
## 108 samples
## 109 cases
## 110 samples
## 111 samples
## 112 samples
## 113 samples
## 114 cases
## 115 samples
## 116 samples
## 117 cases
## 118 samples
## 119 cases
## 120 samples
## 121 samples
## 122 samples
## 123 samples
## 124 samples
## 125 samples
## 126 samples
## 127 cases
## 128 samples
## 129 samples
## 130 samples
## 131 samples
## 132 samples
## 133 cases
## 134 samples
## 135 samples
## 136 samples
## 137 cases
## 138 samples
## 139 cases
## 140 samples
## 141 samples
## 142 samples
## 143 cases
## 144 samples
## 145 samples
## 146 samples
## 147 cases
## 148 samples
## 149
## 150 samples
## 151 samples
## 152 samples
## 153 samples
## 154 samples
## 155 samples
## 156
## 157 cases
## 158
## 159 cases
## 160 samples
## 161 samples
## 162 samples
## 163 samples
## 164 samples
## 165 samples
## 166 samples
## 167 samples
## 168 samples
## 169 samples
## 170 samples
## 171 samples
## 172 samples
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Confirmed.cases.
## 1 49,621
## 2 96,838
## 3 58,574
## 4 37,958
## 5 20,981
## 6 832
## 7 9,060,495
## 8 422,963
## 9 10,112,229
## 10 5,789,991
## 11 792,638
## 12 37,483
## 13 696,614
## 14 1,151,644
## 15 103,014
## 16 982,809
## 17 4,691,499
## 18 60,694
## 19 7,884
## 20 12,702
## 21 910,228
## 22 399,887
## 23 232,432
## 24 10,081,676
## 25 338
## 26 1,295,524
## 27 12,123
## 28 884
## 29 77,914
## 30 32,681
## 31 4,423,053
## 32 4,020
## 33 5,123,007
## 34 87,655
## 35 6,314,769
## 36 561,054
## 37 1,267,798
## 38 1,112,470
## 39 644,160
## 40 4,590,529
## 41 3,399,947
## 42 15,631
## 43 14,821
## 44 626,030
## 45 25,961
## 46 480,720
## 47 283,947
## 48 161,052
## 49 17,113
## 50 613,954
## 51 49,253
## 52 278,446
## 53 34,237
## 54 68,848
## 55 371,135
## 56 29,183,646
## 57 25,325
## 58 4,469
## 59 732,965
## 60 3,733,519
## 61 96,708
## 62 5,548,487
## 63 10,662
## 64 161
## 65 1,230,098
## 66 24,878
## 67 8,400
## 68 66,129
## 69 33,874
## 70 377,859
## 71 1,909,948
## 72 203,162
## 73 43,585,554
## 74 6,812,127
## 75 7,232,268
## 76 2,448,484
## 77 1,700,817
## 78 1,792,137
## 79 25,651,205
## 80 33,285
## 81 151,931
## 82 432,773
## 83 739,847
## 84 385,144
## 85 107,729
## 86 107,410
## 87 624,573
## 88 85,253
## 89 45
## 90 144,518
## 91 542,649
## 92 32,910
## 93 5,396
## 94 501,862
## 95 1,170,108
## 96 244,182
## 97 19,831
## 98 88,086
## 99 1,880,734
## 100 174,658
## 101 14,449
## 102 36,606
## 103 18,103
## 104 494
## 105 3,749,860
## 106 516,864
## 107 136,053
## 108 98,449
## 109 1,272,299
## 110 105,866
## 111 440,741
## 112 166,229
## 113 984,475
## 114 1,692,834
## 115 136
## 116 2,136,662
## 117 4,740
## 118 155,657
## 119 0
## 120 155,689
## 121 103,034
## 122 554,778
## 123 114,434
## 124 588,728
## 125 574,105
## 126 1,029,701
## 127 961
## 128 647,950
## 129 4,177,786
## 130 4,073,980
## 131 5,993,861
## 132 1,499,976
## 133 473,440
## 134 724,250
## 135 18,358,459
## 136 98,209
## 137 995
## 138 29,550
## 139 9,585
## 140 23,427
## 141 753,632
## 142 46,509
## 143 2,473,599
## 144 65,315
## 145 1,861,034
## 146 1,322,282
## 147 1,637,848
## 148 90,029
## 149 10,688
## 150 3,821,305
## 151 93,128
## 152 23,316
## 153 1,074,751
## 154 4,276,836
## 155 8,622,129
## 156 509
## 157 26,162
## 158 39,358
## 159 92,997
## 160 703,732
## 161 5,435,831
## 162 39,979
## 163 3,367,461
## 164 1,049,537
## 165 22,232,377
## 166 90,749,469
## 167 895,592
## 168 43,975
## 169 159,149
## 170 11,403,302
## 171 314,850
## 172 257,893
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Confirmed..tested..
## 1 32.1
## 2 22.6
## 3 25.4
## 4 12.6
## 5 5.3
## 6 5.4
## 7 25.4
## 8 13.6
## 9 12.9
## 10 2.8
## 11 11.6
## 12 14.5
## 13 6.6
## 14 15.5
## 15 13.4
## 16 7.4
## 17 12.8
## 18 10.6
## 19 1.3
## 20 0.73
## 21 20.9
## 22 21.4
## 23 11.5
## 24 42.8
## 25 0.22
## 26 11.8
## 27 7.6
## 28 0.98
## 29 4.3
## 30 3.5
## 31 6.7
## 32 4.1
## 33 10.6
## 34 0.055
## 35 17.1
## 36 21.8
## 37 23.1
## 38 7.8
## 39 2.3
## 40 20.4
## 41 5.0
## 42 5.1
## 43 7.1
## 44 17.5
## 45 20.8
## 46 29.5
## 47 9.1
## 48 8.7
## 49 4.2
## 50 16.9
## 51 11.9
## 52 9.3
## 53 4.4
## 54 10.3
## 55 4.1
## 56 10.7
## 57 2.6
## 58 10.3
## 59 15.0
## 60 5.7
## 61 7.4
## 62 5.5
## 63 6.5
## 64 0.56
## 65 18.1
## 66 5.0
## 67 5.8
## 68 10.2
## 69 15.2
## 70 33.3
## 71 16.8
## 72 10.2
## 73 5.0
## 74 9.0
## 75 13.8
## 76 12.8
## 77 13.1
## 78 4.3
## 79 9.5
## 80 7.8
## 81 12.8
## 82 5.1
## 83 10.0
## 84 3.3
## 85 8.1
## 86 17.6
## 87 8.1
## 88 12.3
## 89 0.039
## 90 4.0
## 91 11.8
## 92 7.6
## 93 4.2
## 94 19.5
## 95 12.9
## 96 5.7
## 97 16.6
## 98 14.1
## 99 7.9
## 100 7.9
## 101 4.5
## 102 3.0
## 103 6.8
## 104 0.17
## 105 35.7
## 106 16.1
## 107 4.1
## 108 25.0
## 109 8.9
## 110 15.4
## 111 10.9
## 112 15.6
## 113 17.0
## 114 11.7
## 115 0.32
## 116 27.5
## 117 6.0
## 118 10.1
## 119 0
## 120 17.7
## 121 1.5
## 122 5.7
## 123 22.4
## 124 6.4
## 125 18.6
## 126 13.8
## 127 2.0
## 128 24.8
## 129 11.6
## 130 11.8
## 131 16.6
## 132 5.5
## 133 11.7
## 134 13.4
## 135 6.2
## 136 3.4
## 137 3.3
## 138 13.9
## 139 8.4
## 140 12.2
## 141 1.8
## 142 7.4
## 143 20.3
## 144 0.40
## 145 25.2
## 146 46.8
## 147 14.4
## 148 1.4
## 149 6.5
## 150 7.1
## 151 3.9
## 152 14.7
## 153 10.8
## 154 18.4
## 155 28.48
## 156 13.1
## 157 1.7
## 158 4.9
## 159 18.1
## 160 24.3
## 161 8.9
## 162 4.7
## 163 21.5
## 164 0.53
## 165 4.3
## 166 9.8
## 167 14.7
## 168 1.7
## 169 5.0
## 170 24.9
## 171 9.5
## 172 10.2
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Tested..population..
## 1 0.40
## 2 15.0
## 3 0.53
## 4 387
## 5 1.3
## 6 15.9
## 7 78.3
## 8 105
## 9 313
## 10 2,312
## 11 69.1
## 12 67.3
## 13 674
## 14 4.5
## 15 268
## 16 139
## 17 317
## 18 140
## 19 5.1
## 20 234
## 21 38.1
## 22 54.7
## 23 89.9
## 24 11.2
## 25 33.5
## 26 158
## 27 0.76
## 28 0.76
## 29 11.2
## 30 3.6
## 31 175
## 32 0.72
## 33 252
## 34 11.1
## 35 76.4
## 36 51.5
## 37 134
## 38 126
## 39 3,223
## 40 211
## 41 1,162
## 42 33.2
## 43 293
## 44 32.9
## 45 0.14
## 46 9.5
## 47 3.1
## 48 28.5
## 49 30.8
## 50 274
## 51 36.5
## 52 2.6
## 53 1,493
## 54 74.5
## 55 163
## 56 417
## 57 3.1
## 58 2.0
## 59 132
## 60 77.8
## 61 4.2
## 62 943
## 63 293
## 64 25.7
## 65 39.4
## 66 3.8
## 67 7.7
## 68 82.5
## 69 2.0
## 70 11.8
## 71 118
## 72 546
## 73 63
## 74 28.2
## 75 62.8
## 76 47.5
## 77 264
## 78 451
## 79 446
## 80 1.6
## 81 43.5
## 82 6.7
## 83 69.5
## 84 62.1
## 85 2.8
## 86 33.8
## 87 181
## 88 10.7
## 89 1.6
## 90 189
## 91 67.4
## 92 21.5
## 93 2.5
## 94 37.6
## 95 324
## 96 679
## 97 0.46
## 98 3.3
## 99 72.3
## 100 398
## 101 1.6
## 102 245
## 103 6.1
## 104 22.9
## 105 8.2
## 106 122
## 107 100
## 108 62.5
## 109 38.5
## 110 2.2
## 111 7.4
## 112 38.7
## 113 20.7
## 114 83.4
## 115 15.7
## 116 156
## 117 0.35
## 118 0.75
## 119 0.066
## 120 42.5
## 121 2,177
## 122 183
## 123 11.0
## 124 4.2
## 125 60.9
## 126 179
## 127 0.53
## 128 36.6
## 129 109.9
## 130 34.1
## 131 94.0
## 132 268
## 133 141
## 134 27.9
## 135 201
## 136 22.3
## 137 57.6
## 138 116.6
## 139 103.0
## 140 563
## 141 120
## 142 3.9
## 143 175
## 144 284
## 145 135
## 146 135
## 147 19.2
## 148 12.7
## 149 1.3
## 150 116
## 151 10.9
## 152 0.36
## 153 96.8
## 154 270
## 155 128.3
## 156 0.0065
## 157 2.3
## 158 9.4
## 159 37.6
## 160 24.5
## 161 73.6
## 162 1.9
## 163 37.2
## 164 2,070
## 165 774
## 166 281
## 167 175
## 168 7.7
## 169 11.0
## 170 46.4
## 171 19.0
## 172 17.0
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Confirmed..population..
## 1 0.13
## 2 3.4
## 3 0.13
## 4 49.0
## 5 0.067
## 6 0.86
## 7 20.0
## 8 14.3
## 9 40.3
## 10 65.0
## 11 8.0
## 12 9.7
## 13 44.4
## 14 0.70
## 15 35.9
## 16 10.4
## 17 40.7
## 18 14.9
## 19 0.067
## 20 1.71
## 21 8.0
## 22 11.7
## 23 10.3
## 24 4.8
## 25 0.074
## 26 18.6
## 27 0.058
## 28 0.0074
## 29 0.48
## 30 0.12
## 31 11.7
## 32 0.029
## 33 26.9
## 34 0.0061
## 35 13.1
## 36 11.2
## 37 31.1
## 38 9.8
## 39 74.4
## 40 42.9
## 41 58.4
## 42 1.7
## 43 20.7
## 44 5.8
## 45 0.029
## 46 2.8
## 47 0.28
## 48 2.5
## 49 1.3
## 50 46.2
## 51 4.3
## 52 0.24
## 53 65.7
## 54 7.7
## 55 6.7
## 56 44.7
## 57 0.082
## 58 0.21
## 59 19.7
## 60 4.5
## 61 0.31
## 62 51.5
## 63 19.0
## 64 0.14
## 65 7.1
## 66 0.19
## 67 0.45
## 68 8.4
## 69 0.30
## 70 3.9
## 71 19.8
## 72 55.8
## 73 31.7
## 74 2.5
## 75 8.7
## 76 6.1
## 77 34.6
## 78 19.5
## 79 42.5
## 80 0.13
## 81 5.6
## 82 0.34
## 83 6.9
## 84 2.1
## 85 0.23
## 86 5.9
## 87 14.6
## 88 1.3
## 89 0.00063
## 90 7.5
## 91 8.0
## 92 1.6
## 93 0.11
## 94 7.3
## 95 41.9
## 96 39.0
## 97 0.076
## 98 0.46
## 99 5.7
## 100 31.3
## 101 0.071
## 102 7.4
## 103 0.41
## 104 0.039
## 105 2.9
## 106 19.6
## 107 4.1
## 108 15.6
## 109 3.4
## 110 0.34
## 111 0.81
## 112 6.1
## 113 3.5
## 114 9.7
## 115 0.050
## 116 42.9
## 117 0.021
## 118 0.076
## 119 0
## 120 7.5
## 121 31.6
## 122 10.3
## 123 2.5
## 124 0.27
## 125 11.4
## 126 24.7
## 127 0.011
## 128 9.1
## 129 12.7
## 130 4.0
## 131 15.6
## 132 14.6
## 133 16.4
## 134 3.7
## 135 12.5
## 136 0.76
## 137 1.9
## 138 16.2
## 139 8.7
## 140 68.4
## 141 2.2
## 142 0.29
## 143 35.5
## 144 1.1
## 145 34.1
## 146 63.1
## 147 2.8
## 148 0.17
## 149 0.084
## 150 8.2
## 151 0.43
## 152 0.053
## 153 10.4
## 154 49.7
## 155 36.528
## 156 0.00085
## 157 0.038
## 158 0.46
## 159 6.8
## 160 6.0
## 161 6.5
## 162 0.087
## 163 8.0
## 164 10.9
## 165 32.9
## 166 27.4
## 167 25.8
## 168 0.13
## 169 0.55
## 170 11.6
## 171 1.8
## 172 1.7
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Ref.
## 1 [1]
## 2 [2]
## 3 [3][4]
## 4 [5]
## 5 [6]
## 6 [7]
## 7 [8]
## 8 [9]
## 9 [10]
## 10 [11]
## 11 [12]
## 12 [13]
## 13 [14]
## 14 [15]
## 15 [16]
## 16 [17]
## 17 [18]
## 18 [19][20]
## 19 [21]
## 20 [22]
## 21 [23]
## 22 [24]
## 23 [25][26]
## 24 [27][28]
## 25 [29]
## 26 [30]
## 27 [3][31]
## 28 [32]
## 29 [33]
## 30 [3]
## 31 [34]
## 32 [3][35]
## 33 [36]
## 34 [37][38]
## 35 [39][40]
## 36 [41]
## 37 [42]
## 38 [43][44]
## 39 [45]
## 40 [46]
## 41 [47][48]
## 42 [49]
## 43 [50]
## 44 [51]
## 45 [3][52]
## 46 [53]
## 47 [3][54]
## 48 [55]
## 49 [56]
## 50 [57]
## 51 [58]
## 52 [59]
## 53 [60]
## 54 [61]
## 55 [62]
## 56 [63]
## 57 [64]
## 58 [65]
## 59 [66]
## 60 [67][68]
## 61 [69]
## 62 [70]
## 63 [71]
## 64 [72]
## 65 [73]
## 66 [3][74]
## 67 [75]
## 68 [76]
## 69 [77]
## 70 [78]
## 71 [79]
## 72 [80]
## 73 [81][82]
## 74
## 75 [83]
## 76 [84]
## 77 [85]
## 78 [86]
## 79 [87]
## 80 [88]
## 81 [89]
## 82 [90]
## 83 [91]
## 84 [92]
## 85 [93]
## 86 [94]
## 87 [95]
## 88 [96]
## 89 [97]
## 90 [98]
## 91 [99]
## 92 [100]
## 93 [101]
## 94 [3][102]
## 95 [103][104]
## 96 [105]
## 97 [106]
## 98 [107]
## 99 [108]
## 100 [109][110]
## 101 [3][111]
## 102 [112]
## 103 [113]
## 104 [114]
## 105 [115]
## 106 [116]
## 107 [117]
## 108 [118][119]
## 109 [120]
## 110 [121]
## 111 [122]
## 112 [123]
## 113 [124]
## 114 [125]
## 115 [126]
## 116 [127][128]
## 117 [129]
## 118 [130]
## 119 [131]
## 120 [132][133]
## 121 [134]
## 122 [135]
## 123 [136]
## 124 [137]
## 125 [138]
## 126 [139]
## 127 [140]
## 128 [141]
## 129 [142]
## 130 [143][144]
## 131 [145]
## 132 [146]
## 133 [147]
## 134 [148]
## 135 [149][150]
## 136 [151]
## 137 [152]
## 138 [153]
## 139 [154]
## 140 [155]
## 141 [156]
## 142 [157]
## 143 [158]
## 144 [159][160]
## 145 [161]
## 146 [162]
## 147 [163][164]
## 148 [165]
## 149 [166]
## 150 [167][168]
## 151 [169][170]
## 152 [3]
## 153 [171][172]
## 154 [173]
## 155 [174]
## 156 [3]
## 157 [175]
## 158 [176]
## 159 [177]
## 160 [178]
## 161 [179]
## 162 [180]
## 163 [181]
## 164 [182]
## 165 [183]
## 166 [184][185]
## 167 [186]
## 168 [187]
## 169 [188]
## 170 [189]
## 171 [190]
## 172 [3][191]
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
# head,tail and summary of the data
head(Covid19)
## Country.or.region Date.a. Tested Units.b. Confirmed.cases.
## 1 Afghanistan 17 Dec 2020 154,767 samples 49,621
## 2 Albania 18 Feb 2021 428,654 samples 96,838
## 3 Algeria 2 Nov 2020 230,553 samples 58,574
## 4 Andorra 23 Feb 2022 300,307 samples 37,958
## 5 Angola 2 Feb 2021 399,228 samples 20,981
## 6 Antigua and Barbuda 6 Mar 2021 15,268 samples 832
## Confirmed..tested.. Tested..population.. Confirmed..population.. Ref.
## 1 32.1 0.40 0.13 [1]
## 2 22.6 15.0 3.4 [2]
## 3 25.4 0.53 0.13 [3][4]
## 4 12.6 387 49.0 [5]
## 5 5.3 1.3 0.067 [6]
## 6 5.4 15.9 0.86 [7]
tail(Covid19)
## Country.or.region
## 168 Uzbekistan
## 169 Venezuela
## 170 Vietnam
## 171 Zambia
## 172 Zimbabwe
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Date.a.
## 168 7 Sep 2020
## 169 30 Mar 2021
## 170 28 Aug 2022
## 171 10 Mar 2022
## 172 15 Oct 2022
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Tested
## 168 2,630,000
## 169 3,179,074
## 170 45,772,571
## 171 3,301,860
## 172 2,529,087
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Units.b.
## 168 samples
## 169 samples
## 170 samples
## 171 samples
## 172 samples
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Confirmed.cases.
## 168 43,975
## 169 159,149
## 170 11,403,302
## 171 314,850
## 172 257,893
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Confirmed..tested..
## 168 1.7
## 169 5.0
## 170 24.9
## 171 9.5
## 172 10.2
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Tested..population..
## 168 7.7
## 169 11.0
## 170 46.4
## 171 19.0
## 172 17.0
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Confirmed..population..
## 168 0.13
## 169 0.55
## 170 11.6
## 171 1.8
## 172 1.7
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
## Ref.
## 168 [187]
## 169 [188]
## 170 [189]
## 171 [190]
## 172 [3][191]
## 173 .mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}\n^ Local time.\n\n^ For some countries it is unclear whether they report samples or cases. One person tested twice is recorded as one case and two samples.\n\n^ Excluding Taiwan.\n\n^ Excluding Northern Cyprus.\n\n^ Excluding Greenland and the Faroe Islands.\n\n^ Excluding Overseas France.\n\n^ Testing data from 4 May to 12 May is missing because of the transition to the new reporting system SI-DEP.\n\n^ Excluding Abkhazia and South Ossetia.\n\n^ Data for residents only.\n\n^ Excluding Transnistria.\n\n^ Northern Cyprus is not recognized as a sovereign state by any country except Turkey.\n\n^ Includes data for Liechtenstein.\n\n^ Not a United Nations member.
summary(Covid19)
## Country.or.region Date.a. Tested Units.b.
## Length:173 Length:173 Length:173 Length:173
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
## Confirmed.cases. Confirmed..tested.. Tested..population..
## Length:173 Length:173 Length:173
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
## Confirmed..population.. Ref.
## Length:173 Length:173
## Class :character Class :character
## Mode :character Mode :character
str(Covid19)
## 'data.frame': 173 obs. of 9 variables:
## $ Country.or.region : chr "Afghanistan" "Albania" "Algeria" "Andorra" ...
## $ Date.a. : chr "17 Dec 2020" "18 Feb 2021" "2 Nov 2020" "23 Feb 2022" ...
## $ Tested : chr "154,767" "428,654" "230,553" "300,307" ...
## $ Units.b. : chr "samples" "samples" "samples" "samples" ...
## $ Confirmed.cases. : chr "49,621" "96,838" "58,574" "37,958" ...
## $ Confirmed..tested.. : chr "32.1" "22.6" "25.4" "12.6" ...
## $ Tested..population.. : chr "0.40" "15.0" "0.53" "387" ...
## $ Confirmed..population..: chr "0.13" "3.4" "0.13" "49.0" ...
## $ Ref. : chr "[1]" "[2]" "[3][4]" "[5]" ...
preprocess_covid_data_frame <- function(Covid19) {
# Remove the last row
Covid19_dframe <- Covid19 [1:172, ]
# We don't need the Units and Ref columns, so can be removed
Covid19_dframe ["Ref."] <- NULL
Covid19_dframe ["Units.b."] <- NULL
# Renaming the columns
names( Covid19_dframe ) <- c("country", "date", "tested", "confirmed", "confirmed.tested.ratio", "tested.population.ratio", "confirmed.population.ratio")
# Convert column data types
Covid19_dframe $country <- as.factor( Covid19_dframe$country)
Covid19_dframe $date <- as.factor( Covid19_dframe$date)
Covid19_dframe $tested <- as.numeric(gsub(",","", Covid19_dframe$tested))
Covid19_dframe $confirmed <- as.numeric(gsub(",","", Covid19_dframe$confirmed))
Covid19_dframe $'confirmed.tested.ratio' <- as.numeric(gsub(",","", Covid19_dframe$'confirmed.tested.ratio'))
Covid19_dframe $'tested.population.ratio' <- as.numeric(gsub(",","", Covid19_dframe$`tested.population.ratio`))
Covid19_dframe$'confirmed.population.ratio' <- as.numeric(gsub(",","", Covid19_dframe$`confirmed.population.ratio`))
return(Covid19_dframe )
}
# Call the preprocessing function and store the result
Covid19_dframe <- preprocess_covid_data_frame(Covid19)
# Now you can inspect the structure
str(Covid19_dframe)
## 'data.frame': 172 obs. of 7 variables:
## $ country : Factor w/ 172 levels "Afghanistan",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ date : Factor w/ 141 levels "1 Aug 2021","1 Feb 2023",..: 32 38 49 60 44 124 29 90 141 2 ...
## $ tested : num 154767 428654 230553 300307 399228 ...
## $ confirmed : num 49621 96838 58574 37958 20981 ...
## $ confirmed.tested.ratio : num 32.1 22.6 25.4 12.6 5.3 5.4 25.4 13.6 12.9 2.8 ...
## $ tested.population.ratio : num 0.4 15 0.53 387 1.3 ...
## $ confirmed.population.ratio: num 0.13 3.4 0.13 49 0.067 0.86 20 14.3 40.3 65 ...
Covid19_dframe <- preprocess_covid_data_frame(Covid19)
Covid19_dframe
## country date tested confirmed
## 1 Afghanistan 17 Dec 2020 154767 49621
## 2 Albania 18 Feb 2021 428654 96838
## 3 Algeria 2 Nov 2020 230553 58574
## 4 Andorra 23 Feb 2022 300307 37958
## 5 Angola 2 Feb 2021 399228 20981
## 6 Antigua and Barbuda 6 Mar 2021 15268 832
## 7 Argentina 16 Apr 2022 35716069 9060495
## 8 Armenia 29 May 2022 3099602 422963
## 9 Australia 9 Sep 2022 78548492 10112229
## 10 Austria 1 Feb 2023 205817752 5789991
## 11 Azerbaijan 11 May 2022 6838458 792638
## 12 Bahamas 28 Nov 2022 259366 37483
## 13 Bahrain 3 Dec 2022 10578766 696614
## 14 Bangladesh 24 Jul 2021 7417714 1151644
## 15 Barbados 14 Oct 2022 770100 103014
## 16 Belarus 9 May 2022 13217569 982809
## 17 Belgium 24 Jan 2023 36548544 4691499
## 18 Belize 8 Jun 2022 572900 60694
## 19 Benin 4 May 2021 595112 7884
## 20 Bhutan 28 Feb 2022 1736168 12702
## 21 Bolivia 5 Jun 2022 4358669 910228
## 22 Bosnia and Herzegovina 27 Sep 2022 1872934 399887
## 23 Botswana 11 Jan 2022 2026898 232432
## 24 Brazil 19 Feb 2021 23561497 10081676
## 25 Brunei 2 Aug 2021 153804 338
## 26 Bulgaria 2 Feb 2023 10993239 1295524
## 27 Burkina Faso 4 Mar 2021 158777 12123
## 28 Burundi 5 Jan 2021 90019 884
## 29 Cambodia 1 Aug 2021 1812706 77914
## 30 Cameroon 18 Feb 2021 942685 32681
## 31 Canada 26 Nov 2022 66343123 4423053
## 32 Chad 2 Mar 2021 99027 4020
## 33 Chile 1 Feb 2023 48154268 5123007
## 34 China[c] 31 Jul 2020 160000000 87655
## 35 Colombia 24 Nov 2022 36875818 6314769
## 36 Costa Rica 2 Nov 2021 2575363 561054
## 37 Croatia 2 Feb 2023 5481285 1267798
## 38 Cuba 2 Feb 2023 14301394 1112470
## 39 Cyprus[d] 29 Jan 2023 27820163 644160
## 40 Czechia 1 Feb 2023 22544928 4590529
## 41 Denmark[e] 31 Jan 2023 67682707 3399947
## 42 Djibouti 28 Apr 2022 305941 15631
## 43 Dominica 20 Jun 2022 209803 14821
## 44 Dominican Republic 22 Jul 2022 3574665 626030
## 45 DR Congo 28 Feb 2021 124838 25961
## 46 Ecuador 23 Jul 2021 1627189 480720
## 47 Egypt 23 Jul 2021 3137519 283947
## 48 El Salvador 18 Mar 2022 1847861 161052
## 49 Equatorial Guinea 30 Jan 2023 403773 17113
## 50 Estonia 31 Jan 2023 3637908 613954
## 51 Eswatini 8 Dec 2021 415110 49253
## 52 Ethiopia 24 Jun 2021 2981185 278446
## 53 Faroe Islands 27 Feb 2022 774000 34237
## 54 Fiji 2 Jan 2023 667953 68848
## 55 Finland 14 Jan 2022 9042453 371135
## 56 France[f][g] 15 May 2022 272417258 29183646
## 57 Gabon 23 Jul 2021 958807 25325
## 58 Gambia 15 Feb 2021 43217 4469
## 59 Georgia[h] 3 Nov 2021 4888787 732965
## 60 Germany 7 Jul 2021 65247345 3733519
## 61 Ghana 3 Jul 2021 1305749 96708
## 62 Greece 18 Dec 2022 101576831 5548487
## 63 Greenland 30 Jan 2022 164573 10662
## 64 Grenada 11 May 2021 28684 161
## 65 Guatemala 6 Jan 2023 6800560 1230098
## 66 Guinea 21 Jul 2021 494898 24878
## 67 Guinea-Bissau 7 Jul 2022 145231 8400
## 68 Guyana 15 Jun 2022 648569 66129
## 69 Haiti 26 Nov 2022 223475 33874
## 70 Honduras 26 Nov 2021 1133782 377859
## 71 Hungary 10 May 2022 11394556 1909948
## 72 Iceland 9 Aug 2022 1988652 203162
## 73 India 8 Jul 2022 866177937 43585554
## 74 Indonesia 3 Jul 2023 76062770 6812127
## 75 Iran 31 May 2022 52269202 7232268
## 76 Iraq 3 Aug 2022 19090652 2448484
## 77 Ireland 31 Jan 2023 12990476 1700817
## 78 Israel 17 Jan 2022 41373364 1792137
## 79 Italy 16 Mar 2023 269127054 25651205
## 80 Ivory Coast 3 Mar 2021 429177 33285
## 81 Jamaica 30 Sep 2022 1184973 151931
## 82 Japan 1 Mar 2021 8487288 432773
## 83 Jordan 6 Jun 2021 7407053 739847
## 84 Kazakhstan 28 May 2021 11575012 385144
## 85 Kenya 5 Mar 2021 1322806 107729
## 86 Kosovo 31 May 2021 611357 107410
## 87 Kuwait 9 Mar 2022 7754247 624573
## 88 Kyrgyzstan 10 Feb 2021 695415 85253
## 89 Laos 1 Mar 2021 114030 45
## 90 Latvia 5 Sep 2021 3630095 144518
## 91 Lebanon 14 Jun 2021 4599186 542649
## 92 Lesotho 30 Mar 2022 431221 32910
## 93 Liberia 17 Jul 2021 128246 5396
## 94 Libya 14 Apr 2022 2578215 501862
## 95 Lithuania 31 Jan 2023 9046584 1170108
## 96 Luxembourg[i] 12 May 2022 4248188 244182
## 97 Madagascar 19 Feb 2021 119608 19831
## 98 Malawi 29 Nov 2022 624784 88086
## 99 Malaysia 7 Sep 2021 23705425 1880734
## 100 Maldives 13 Mar 2022 2216560 174658
## 101 Mali 7 Jul 2021 322504 14449
## 102 Malta 8 Sep 2021 1211456 36606
## 103 Mauritania 16 Apr 2021 268093 18103
## 104 Mauritius 22 Nov 2020 289552 494
## 105 Mexico 15 Oct 2021 10503678 3749860
## 106 Moldova[j] 20 Apr 2022 3213594 516864
## 107 Mongolia 10 Jul 2021 3354200 136053
## 108 Montenegro 10 May 2021 394388 98449
## 109 Morocco 6 Jan 2023 14217563 1272299
## 110 Mozambique 22 Jul 2021 688570 105866
## 111 Myanmar 16 Sep 2021 4047680 440741
## 112 Namibia 4 Jul 2022 1062663 166229
## 113 Nepal 26 Jul 2022 5804358 984475
## 114 Netherlands 6 Jul 2021 14526293 1692834
## 115 New Caledonia 3 Sep 2021 41962 136
## 116 New Zealand 29 Jan 2023 7757935 2136662
## 117 Niger 22 Feb 2021 79321 4740
## 118 Nigeria 28 Feb 2021 1544008 155657
## 119 North Korea 25 Nov 2020 16914 0
## 120 North Macedonia 1 Jul 2021 881870 155689
## 121 Northern Cyprus[k] 12 Jul 2022 7096998 103034
## 122 Norway 20 Jan 2022 9811888 554778
## 123 Oman 28 Oct 2020 509959 114434
## 124 Pakistan 5 Mar 2021 9173593 588728
## 125 Palestine 5 Feb 2022 3078533 574105
## 126 Panama 28 Jan 2023 7475016 1029701
## 127 Papua New Guinea 17 Feb 2021 47490 961
## 128 Paraguay 27 Mar 2022 2609819 647950
## 129 Peru 17 Nov 2022 36073768 4177786
## 130 Philippines 7 Jan 2023 34402980 4073980
## 131 Poland 27 Apr 2022 36064311 5993861
## 132 Portugal 5 Jan 2022 27515490 1499976
## 133 Qatar 11 Nov 2022 4061988 473440
## 134 Romania 29 Jan 2021 5405393 724250
## 135 Russia 6 Jun 2022 295542733 18358459
## 136 Rwanda 6 Oct 2021 2885812 98209
## 137 Saint Kitts and Nevis 26 Aug 2021 30231 995
## 138 Saint Lucia 7 Oct 2022 212132 29550
## 139 Saint Vincent 28 Jan 2023 113504 9585
## 140 San Marino 29 Jan 2023 192613 23427
## 141 Saudi Arabia 26 Apr 2022 41849069 753632
## 142 Senegal 12 Jul 2021 624502 46509
## 143 Serbia 2 Feb 2023 12185475 2473599
## 144 Singapore 3 Aug 2021 16206203 65315
## 145 Slovakia 2 Feb 2023 7391882 1861034
## 146 Slovenia 2 Feb 2023 2826117 1322282
## 147 South Africa 24 May 2021 11378282 1637848
## 148 South Korea 1 Mar 2021 6592010 90029
## 149 South Sudan 26 May 2021 164472 10688
## 150 Spain 1 Jul 2021 54128524 3821305
## 151 Sri Lanka 30 Mar 2021 2384745 93128
## 152 Sudan 7 Jan 2021 158804 23316
## 153 Sweden 24 May 2021 9996795 1074751
## 154 Switzerland[l] 7 Nov 2022 23283909 4276836
## 155 Taiwan[m] 3 Feb 2023 30275725 8622129
## 156 Tanzania 18 Nov 2020 3880 509
## 157 Thailand 4 Mar 2021 1579597 26162
## 158 Togo 6 Jan 2023 807269 39358
## 159 Trinidad and Tobago 3 Jan 2022 512730 92997
## 160 Tunisia 23 Aug 2021 2893625 703732
## 161 Turkey 2 Jul 2021 61236294 5435831
## 162 Uganda 11 Feb 2021 852444 39979
## 163 Ukraine 24 Nov 2021 15648456 3367461
## 164 United Arab Emirates 1 Feb 2023 198685717 1049537
## 165 United Kingdom 19 May 2022 522526476 22232377
## 166 United States 29 Jul 2022 929349291 90749469
## 167 Uruguay 16 Apr 2022 6089116 895592
## 168 Uzbekistan 7 Sep 2020 2630000 43975
## 169 Venezuela 30 Mar 2021 3179074 159149
## 170 Vietnam 28 Aug 2022 45772571 11403302
## 171 Zambia 10 Mar 2022 3301860 314850
## 172 Zimbabwe 15 Oct 2022 2529087 257893
## confirmed.tested.ratio tested.population.ratio confirmed.population.ratio
## 1 32.100 0.4000 0.13000
## 2 22.600 15.0000 3.40000
## 3 25.400 0.5300 0.13000
## 4 12.600 387.0000 49.00000
## 5 5.300 1.3000 0.06700
## 6 5.400 15.9000 0.86000
## 7 25.400 78.3000 20.00000
## 8 13.600 105.0000 14.30000
## 9 12.900 313.0000 40.30000
## 10 2.800 2312.0000 65.00000
## 11 11.600 69.1000 8.00000
## 12 14.500 67.3000 9.70000
## 13 6.600 674.0000 44.40000
## 14 15.500 4.5000 0.70000
## 15 13.400 268.0000 35.90000
## 16 7.400 139.0000 10.40000
## 17 12.800 317.0000 40.70000
## 18 10.600 140.0000 14.90000
## 19 1.300 5.1000 0.06700
## 20 0.730 234.0000 1.71000
## 21 20.900 38.1000 8.00000
## 22 21.400 54.7000 11.70000
## 23 11.500 89.9000 10.30000
## 24 42.800 11.2000 4.80000
## 25 0.220 33.5000 0.07400
## 26 11.800 158.0000 18.60000
## 27 7.600 0.7600 0.05800
## 28 0.980 0.7600 0.00740
## 29 4.300 11.2000 0.48000
## 30 3.500 3.6000 0.12000
## 31 6.700 175.0000 11.70000
## 32 4.100 0.7200 0.02900
## 33 10.600 252.0000 26.90000
## 34 0.055 11.1000 0.00610
## 35 17.100 76.4000 13.10000
## 36 21.800 51.5000 11.20000
## 37 23.100 134.0000 31.10000
## 38 7.800 126.0000 9.80000
## 39 2.300 3223.0000 74.40000
## 40 20.400 211.0000 42.90000
## 41 5.000 1162.0000 58.40000
## 42 5.100 33.2000 1.70000
## 43 7.100 293.0000 20.70000
## 44 17.500 32.9000 5.80000
## 45 20.800 0.1400 0.02900
## 46 29.500 9.5000 2.80000
## 47 9.100 3.1000 0.28000
## 48 8.700 28.5000 2.50000
## 49 4.200 30.8000 1.30000
## 50 16.900 274.0000 46.20000
## 51 11.900 36.5000 4.30000
## 52 9.300 2.6000 0.24000
## 53 4.400 1493.0000 65.70000
## 54 10.300 74.5000 7.70000
## 55 4.100 163.0000 6.70000
## 56 10.700 417.0000 44.70000
## 57 2.600 3.1000 0.08200
## 58 10.300 2.0000 0.21000
## 59 15.000 132.0000 19.70000
## 60 5.700 77.8000 4.50000
## 61 7.400 4.2000 0.31000
## 62 5.500 943.0000 51.50000
## 63 6.500 293.0000 19.00000
## 64 0.560 25.7000 0.14000
## 65 18.100 39.4000 7.10000
## 66 5.000 3.8000 0.19000
## 67 5.800 7.7000 0.45000
## 68 10.200 82.5000 8.40000
## 69 15.200 2.0000 0.30000
## 70 33.300 11.8000 3.90000
## 71 16.800 118.0000 19.80000
## 72 10.200 546.0000 55.80000
## 73 5.000 63.0000 31.70000
## 74 9.000 28.2000 2.50000
## 75 13.800 62.8000 8.70000
## 76 12.800 47.5000 6.10000
## 77 13.100 264.0000 34.60000
## 78 4.300 451.0000 19.50000
## 79 9.500 446.0000 42.50000
## 80 7.800 1.6000 0.13000
## 81 12.800 43.5000 5.60000
## 82 5.100 6.7000 0.34000
## 83 10.000 69.5000 6.90000
## 84 3.300 62.1000 2.10000
## 85 8.100 2.8000 0.23000
## 86 17.600 33.8000 5.90000
## 87 8.100 181.0000 14.60000
## 88 12.300 10.7000 1.30000
## 89 0.039 1.6000 0.00063
## 90 4.000 189.0000 7.50000
## 91 11.800 67.4000 8.00000
## 92 7.600 21.5000 1.60000
## 93 4.200 2.5000 0.11000
## 94 19.500 37.6000 7.30000
## 95 12.900 324.0000 41.90000
## 96 5.700 679.0000 39.00000
## 97 16.600 0.4600 0.07600
## 98 14.100 3.3000 0.46000
## 99 7.900 72.3000 5.70000
## 100 7.900 398.0000 31.30000
## 101 4.500 1.6000 0.07100
## 102 3.000 245.0000 7.40000
## 103 6.800 6.1000 0.41000
## 104 0.170 22.9000 0.03900
## 105 35.700 8.2000 2.90000
## 106 16.100 122.0000 19.60000
## 107 4.100 100.0000 4.10000
## 108 25.000 62.5000 15.60000
## 109 8.900 38.5000 3.40000
## 110 15.400 2.2000 0.34000
## 111 10.900 7.4000 0.81000
## 112 15.600 38.7000 6.10000
## 113 17.000 20.7000 3.50000
## 114 11.700 83.4000 9.70000
## 115 0.320 15.7000 0.05000
## 116 27.500 156.0000 42.90000
## 117 6.000 0.3500 0.02100
## 118 10.100 0.7500 0.07600
## 119 0.000 0.0660 0.00000
## 120 17.700 42.5000 7.50000
## 121 1.500 2177.0000 31.60000
## 122 5.700 183.0000 10.30000
## 123 22.400 11.0000 2.50000
## 124 6.400 4.2000 0.27000
## 125 18.600 60.9000 11.40000
## 126 13.800 179.0000 24.70000
## 127 2.000 0.5300 0.01100
## 128 24.800 36.6000 9.10000
## 129 11.600 109.9000 12.70000
## 130 11.800 34.1000 4.00000
## 131 16.600 94.0000 15.60000
## 132 5.500 268.0000 14.60000
## 133 11.700 141.0000 16.40000
## 134 13.400 27.9000 3.70000
## 135 6.200 201.0000 12.50000
## 136 3.400 22.3000 0.76000
## 137 3.300 57.6000 1.90000
## 138 13.900 116.6000 16.20000
## 139 8.400 103.0000 8.70000
## 140 12.200 563.0000 68.40000
## 141 1.800 120.0000 2.20000
## 142 7.400 3.9000 0.29000
## 143 20.300 175.0000 35.50000
## 144 0.400 284.0000 1.10000
## 145 25.200 135.0000 34.10000
## 146 46.800 135.0000 63.10000
## 147 14.400 19.2000 2.80000
## 148 1.400 12.7000 0.17000
## 149 6.500 1.3000 0.08400
## 150 7.100 116.0000 8.20000
## 151 3.900 10.9000 0.43000
## 152 14.700 0.3600 0.05300
## 153 10.800 96.8000 10.40000
## 154 18.400 270.0000 49.70000
## 155 28.480 128.3000 36.52800
## 156 13.100 0.0065 0.00085
## 157 1.700 2.3000 0.03800
## 158 4.900 9.4000 0.46000
## 159 18.100 37.6000 6.80000
## 160 24.300 24.5000 6.00000
## 161 8.900 73.6000 6.50000
## 162 4.700 1.9000 0.08700
## 163 21.500 37.2000 8.00000
## 164 0.530 2070.0000 10.90000
## 165 4.300 774.0000 32.90000
## 166 9.800 281.0000 27.40000
## 167 14.700 175.0000 25.80000
## 168 1.700 7.7000 0.13000
## 169 5.000 11.0000 0.55000
## 170 24.900 46.4000 11.60000
## 171 9.500 19.0000 1.80000
## 172 10.200 17.0000 1.70000
#(3b)
# export the data frame to a csv file
write.table(Covid19_dframe ,"my_covid19_project.csv")
# to get the working directory
vid19 <- getwd()
vid19
## [1] "C:/Users/HomePC/Desktop/Raheem.R"
#get exported
file_path <- paste(vid19,sep="","/my_covid19_project.csv")
# file path
file_path
## [1] "C:/Users/HomePC/Desktop/Raheem.R/my_covid19_project.csv"
file.exists(file_path)
## [1] TRUE
#The goal of task 2 is to get the 5th to 10th rows from the data frame with only country,date and confirmed columns selected
Covid19_data_frame_csv <- read.table("C:/Users/HomePC/Desktop/Raheem.R/my_covid19_project.csv",sep = "")
head(Covid19_data_frame_csv)
## country date tested confirmed confirmed.tested.ratio
## 1 Afghanistan 17 Dec 2020 154767 49621 32.1
## 2 Albania 18 Feb 2021 428654 96838 22.6
## 3 Algeria 2 Nov 2020 230553 58574 25.4
## 4 Andorra 23 Feb 2022 300307 37958 12.6
## 5 Angola 2 Feb 2021 399228 20981 5.3
## 6 Antigua and Barbuda 6 Mar 2021 15268 832 5.4
## tested.population.ratio confirmed.population.ratio
## 1 0.40 0.130
## 2 15.00 3.400
## 3 0.53 0.130
## 4 387.00 49.000
## 5 1.30 0.067
## 6 15.90 0.860
subset<- Covid19_data_frame_csv[5:10, c("country","date", "confirmed")]
subset
## country date confirmed
## 5 Angola 2 Feb 2021 20981
## 6 Antigua and Barbuda 6 Mar 2021 832
## 7 Argentina 16 Apr 2022 9060495
## 8 Armenia 29 May 2022 422963
## 9 Australia 9 Sep 2022 10112229
## 10 Austria 1 Feb 2023 5789991
The goal is to get the total confirmed and tested cases worldwide, and try to figure the overall positive ratio using confirmed cases / tested cases
total_confirmed_cases <- sum(Covid19_data_frame_csv$confirmed, na.rm = TRUE)
total_tested_cases <- sum(Covid19_data_frame_csv$tested, na.rm = TRUE)
positive_ratio <- total_confirmed_cases / total_tested_cases
# Create a summary table
summary_table <- data.frame(
Metric = c("Total Confirmed Cases", "Total Tested Cases", "Positive Ratio"),
Value = c(total_confirmed_cases, total_tested_cases, round(positive_ratio, 4))
)
# Display the table
kable(summary_table, caption = "Worldwide COVID-19 Testing Summary")
| Metric | Value |
|---|---|
| Total Confirmed Cases | 431434555.0000 |
| Total Tested Cases | 5396881644.0000 |
| Positive Ratio | 0.0799 |
The goal to get a catalog or sorted list of countries who have reported their COVID-19 testing data get the ‘country’ column.
Covid19_data_frame_csv$country
## [1] "Afghanistan" "Albania" "Algeria"
## [4] "Andorra" "Angola" "Antigua and Barbuda"
## [7] "Argentina" "Armenia" "Australia"
## [10] "Austria" "Azerbaijan" "Bahamas"
## [13] "Bahrain" "Bangladesh" "Barbados"
## [16] "Belarus" "Belgium" "Belize"
## [19] "Benin" "Bhutan" "Bolivia"
## [22] "Bosnia and Herzegovina" "Botswana" "Brazil"
## [25] "Brunei" "Bulgaria" "Burkina Faso"
## [28] "Burundi" "Cambodia" "Cameroon"
## [31] "Canada" "Chad" "Chile"
## [34] "China[c]" "Colombia" "Costa Rica"
## [37] "Croatia" "Cuba" "Cyprus[d]"
## [40] "Czechia" "Denmark[e]" "Djibouti"
## [43] "Dominica" "Dominican Republic" "DR Congo"
## [46] "Ecuador" "Egypt" "El Salvador"
## [49] "Equatorial Guinea" "Estonia" "Eswatini"
## [52] "Ethiopia" "Faroe Islands" "Fiji"
## [55] "Finland" "France[f][g]" "Gabon"
## [58] "Gambia" "Georgia[h]" "Germany"
## [61] "Ghana" "Greece" "Greenland"
## [64] "Grenada" "Guatemala" "Guinea"
## [67] "Guinea-Bissau" "Guyana" "Haiti"
## [70] "Honduras" "Hungary" "Iceland"
## [73] "India" "Indonesia" "Iran"
## [76] "Iraq" "Ireland" "Israel"
## [79] "Italy" "Ivory Coast" "Jamaica"
## [82] "Japan" "Jordan" "Kazakhstan"
## [85] "Kenya" "Kosovo" "Kuwait"
## [88] "Kyrgyzstan" "Laos" "Latvia"
## [91] "Lebanon" "Lesotho" "Liberia"
## [94] "Libya" "Lithuania" "Luxembourg[i]"
## [97] "Madagascar" "Malawi" "Malaysia"
## [100] "Maldives" "Mali" "Malta"
## [103] "Mauritania" "Mauritius" "Mexico"
## [106] "Moldova[j]" "Mongolia" "Montenegro"
## [109] "Morocco" "Mozambique" "Myanmar"
## [112] "Namibia" "Nepal" "Netherlands"
## [115] "New Caledonia" "New Zealand" "Niger"
## [118] "Nigeria" "North Korea" "North Macedonia"
## [121] "Northern Cyprus[k]" "Norway" "Oman"
## [124] "Pakistan" "Palestine" "Panama"
## [127] "Papua New Guinea" "Paraguay" "Peru"
## [130] "Philippines" "Poland" "Portugal"
## [133] "Qatar" "Romania" "Russia"
## [136] "Rwanda" "Saint Kitts and Nevis" "Saint Lucia"
## [139] "Saint Vincent" "San Marino" "Saudi Arabia"
## [142] "Senegal" "Serbia" "Singapore"
## [145] "Slovakia" "Slovenia" "South Africa"
## [148] "South Korea" "South Sudan" "Spain"
## [151] "Sri Lanka" "Sudan" "Sweden"
## [154] "Switzerland[l]" "Taiwan[m]" "Tanzania"
## [157] "Thailand" "Togo" "Trinidad and Tobago"
## [160] "Tunisia" "Turkey" "Uganda"
## [163] "Ukraine" "United Arab Emirates" "United Kingdom"
## [166] "United States" "Uruguay" "Uzbekistan"
## [169] "Venezuela" "Vietnam" "Zambia"
## [172] "Zimbabwe"
# check the class (it should be character)
class(Covid19_data_frame_csv$country)
## [1] "character"
#Sort the countries AtoZ
A_to_Z <- sort(Covid19_data_frame_csv$country,decreasing=FALSE)
A_to_Z
## [1] "Afghanistan" "Albania" "Algeria"
## [4] "Andorra" "Angola" "Antigua and Barbuda"
## [7] "Argentina" "Armenia" "Australia"
## [10] "Austria" "Azerbaijan" "Bahamas"
## [13] "Bahrain" "Bangladesh" "Barbados"
## [16] "Belarus" "Belgium" "Belize"
## [19] "Benin" "Bhutan" "Bolivia"
## [22] "Bosnia and Herzegovina" "Botswana" "Brazil"
## [25] "Brunei" "Bulgaria" "Burkina Faso"
## [28] "Burundi" "Cambodia" "Cameroon"
## [31] "Canada" "Chad" "Chile"
## [34] "China[c]" "Colombia" "Costa Rica"
## [37] "Croatia" "Cuba" "Cyprus[d]"
## [40] "Czechia" "Denmark[e]" "Djibouti"
## [43] "Dominica" "Dominican Republic" "DR Congo"
## [46] "Ecuador" "Egypt" "El Salvador"
## [49] "Equatorial Guinea" "Estonia" "Eswatini"
## [52] "Ethiopia" "Faroe Islands" "Fiji"
## [55] "Finland" "France[f][g]" "Gabon"
## [58] "Gambia" "Georgia[h]" "Germany"
## [61] "Ghana" "Greece" "Greenland"
## [64] "Grenada" "Guatemala" "Guinea"
## [67] "Guinea-Bissau" "Guyana" "Haiti"
## [70] "Honduras" "Hungary" "Iceland"
## [73] "India" "Indonesia" "Iran"
## [76] "Iraq" "Ireland" "Israel"
## [79] "Italy" "Ivory Coast" "Jamaica"
## [82] "Japan" "Jordan" "Kazakhstan"
## [85] "Kenya" "Kosovo" "Kuwait"
## [88] "Kyrgyzstan" "Laos" "Latvia"
## [91] "Lebanon" "Lesotho" "Liberia"
## [94] "Libya" "Lithuania" "Luxembourg[i]"
## [97] "Madagascar" "Malawi" "Malaysia"
## [100] "Maldives" "Mali" "Malta"
## [103] "Mauritania" "Mauritius" "Mexico"
## [106] "Moldova[j]" "Mongolia" "Montenegro"
## [109] "Morocco" "Mozambique" "Myanmar"
## [112] "Namibia" "Nepal" "Netherlands"
## [115] "New Caledonia" "New Zealand" "Niger"
## [118] "Nigeria" "North Korea" "North Macedonia"
## [121] "Northern Cyprus[k]" "Norway" "Oman"
## [124] "Pakistan" "Palestine" "Panama"
## [127] "Papua New Guinea" "Paraguay" "Peru"
## [130] "Philippines" "Poland" "Portugal"
## [133] "Qatar" "Romania" "Russia"
## [136] "Rwanda" "Saint Kitts and Nevis" "Saint Lucia"
## [139] "Saint Vincent" "San Marino" "Saudi Arabia"
## [142] "Senegal" "Serbia" "Singapore"
## [145] "Slovakia" "Slovenia" "South Africa"
## [148] "South Korea" "South Sudan" "Spain"
## [151] "Sri Lanka" "Sudan" "Sweden"
## [154] "Switzerland[l]" "Taiwan[m]" "Tanzania"
## [157] "Thailand" "Togo" "Trinidad and Tobago"
## [160] "Tunisia" "Turkey" "Uganda"
## [163] "Ukraine" "United Arab Emirates" "United Kingdom"
## [166] "United States" "Uruguay" "Uzbekistan"
## [169] "Venezuela" "Vietnam" "Zambia"
## [172] "Zimbabwe"
#Sort the countries ZtoA
Z_to_A <- sort(Covid19_data_frame_csv$country,decreasing=TRUE)
#Print the sorted ZtoA list
Z_to_A
## [1] "Zimbabwe" "Zambia" "Vietnam"
## [4] "Venezuela" "Uzbekistan" "Uruguay"
## [7] "United States" "United Kingdom" "United Arab Emirates"
## [10] "Ukraine" "Uganda" "Turkey"
## [13] "Tunisia" "Trinidad and Tobago" "Togo"
## [16] "Thailand" "Tanzania" "Taiwan[m]"
## [19] "Switzerland[l]" "Sweden" "Sudan"
## [22] "Sri Lanka" "Spain" "South Sudan"
## [25] "South Korea" "South Africa" "Slovenia"
## [28] "Slovakia" "Singapore" "Serbia"
## [31] "Senegal" "Saudi Arabia" "San Marino"
## [34] "Saint Vincent" "Saint Lucia" "Saint Kitts and Nevis"
## [37] "Rwanda" "Russia" "Romania"
## [40] "Qatar" "Portugal" "Poland"
## [43] "Philippines" "Peru" "Paraguay"
## [46] "Papua New Guinea" "Panama" "Palestine"
## [49] "Pakistan" "Oman" "Norway"
## [52] "Northern Cyprus[k]" "North Macedonia" "North Korea"
## [55] "Nigeria" "Niger" "New Zealand"
## [58] "New Caledonia" "Netherlands" "Nepal"
## [61] "Namibia" "Myanmar" "Mozambique"
## [64] "Morocco" "Montenegro" "Mongolia"
## [67] "Moldova[j]" "Mexico" "Mauritius"
## [70] "Mauritania" "Malta" "Mali"
## [73] "Maldives" "Malaysia" "Malawi"
## [76] "Madagascar" "Luxembourg[i]" "Lithuania"
## [79] "Libya" "Liberia" "Lesotho"
## [82] "Lebanon" "Latvia" "Laos"
## [85] "Kyrgyzstan" "Kuwait" "Kosovo"
## [88] "Kenya" "Kazakhstan" "Jordan"
## [91] "Japan" "Jamaica" "Ivory Coast"
## [94] "Italy" "Israel" "Ireland"
## [97] "Iraq" "Iran" "Indonesia"
## [100] "India" "Iceland" "Hungary"
## [103] "Honduras" "Haiti" "Guyana"
## [106] "Guinea-Bissau" "Guinea" "Guatemala"
## [109] "Grenada" "Greenland" "Greece"
## [112] "Ghana" "Germany" "Georgia[h]"
## [115] "Gambia" "Gabon" "France[f][g]"
## [118] "Finland" "Fiji" "Faroe Islands"
## [121] "Ethiopia" "Eswatini" "Estonia"
## [124] "Equatorial Guinea" "El Salvador" "Egypt"
## [127] "Ecuador" "DR Congo" "Dominican Republic"
## [130] "Dominica" "Djibouti" "Denmark[e]"
## [133] "Czechia" "Cyprus[d]" "Cuba"
## [136] "Croatia" "Costa Rica" "Colombia"
## [139] "China[c]" "Chile" "Chad"
## [142] "Canada" "Cameroon" "Cambodia"
## [145] "Burundi" "Burkina Faso" "Bulgaria"
## [148] "Brunei" "Brazil" "Botswana"
## [151] "Bosnia and Herzegovina" "Bolivia" "Bhutan"
## [154] "Benin" "Belize" "Belgium"
## [157] "Belarus" "Barbados" "Bangladesh"
## [160] "Bahrain" "Bahamas" "Azerbaijan"
## [163] "Austria" "Australia" "Armenia"
## [166] "Argentina" "Antigua and Barbuda" "Angola"
## [169] "Andorra" "Algeria" "Albania"
## [172] "Afghanistan"
The goal is to use a regular expression to find any countries starting with A.
matches <- regexpr("A.+",Covid19_data_frame_csv$country)#regexpr is to pick a specific pattern
regmatches(Covid19_data_frame_csv$country,matches)
## [1] "Afghanistan" "Albania" "Algeria"
## [4] "Andorra" "Angola" "Antigua and Barbuda"
## [7] "Argentina" "Armenia" "Australia"
## [10] "Austria" "Azerbaijan" "Arabia"
## [13] "Africa" "Arab Emirates"
country_a <- Covid19_data_frame_csv[118, c(1, 4, 7)]
country_b <- Covid19_data_frame_csv[6, c(1, 4, 7)]
# Combine into one data frame
comparison_df <- rbind(country_a, country_b)
# rename the rows for clarity
rownames(comparison_df) <- c("Country A", "Country B")
# Print the combined data frame
print(comparison_df)
## country confirmed confirmed.population.ratio
## Country A Nigeria 155657 0.076
## Country B Antigua and Barbuda 832 0.860
The goal is to find out which country i have selected before has larger ratio of confirmed cases to population, which may indicate that the country has higher COVID-19 infection risk Using the if-else statement.
if(country_a[2]>country_b[2]){
print("Nigeria has more populations afected with covid19 hence is not safer than Antigua and Barbuda ")
}else{
print("Antigua and Barbuda has more populations afected with covid19 hence is not safer than Nigeria")
}
## [1] "Nigeria has more populations afected with covid19 hence is not safer than Antigua and Barbuda "
The goal is to find out which countries has the confirmed cases to population ratio less than 1%, it may indicate the risk of those countries are relatively low.
threshold <- 1
# Filter countries with confirmed.population.ratio < 1%
low_risk_df <- Covid19_data_frame_csv %>%
filter(confirmed.population.ratio < threshold) %>%
select(country, confirmed.population.ratio) %>%
arrange(confirmed.population.ratio)
# Display as a table
kable(low_risk_df, caption = "Countries with Confirmed Cases to Population Ratio Below 1%")
| country | confirmed.population.ratio | |
|---|---|---|
| 119 | North Korea | 0.00000 |
| 89 | Laos | 0.00063 |
| 156 | Tanzania | 0.00085 |
| 34 | China[c] | 0.00610 |
| 28 | Burundi | 0.00740 |
| 127 | Papua New Guinea | 0.01100 |
| 117 | Niger | 0.02100 |
| 32 | Chad | 0.02900 |
| 45 | DR Congo | 0.02900 |
| 157 | Thailand | 0.03800 |
| 104 | Mauritius | 0.03900 |
| 115 | New Caledonia | 0.05000 |
| 152 | Sudan | 0.05300 |
| 27 | Burkina Faso | 0.05800 |
| 5 | Angola | 0.06700 |
| 19 | Benin | 0.06700 |
| 101 | Mali | 0.07100 |
| 25 | Brunei | 0.07400 |
| 97 | Madagascar | 0.07600 |
| 118 | Nigeria | 0.07600 |
| 57 | Gabon | 0.08200 |
| 149 | South Sudan | 0.08400 |
| 162 | Uganda | 0.08700 |
| 93 | Liberia | 0.11000 |
| 30 | Cameroon | 0.12000 |
| 1 | Afghanistan | 0.13000 |
| 3 | Algeria | 0.13000 |
| 80 | Ivory Coast | 0.13000 |
| 168 | Uzbekistan | 0.13000 |
| 64 | Grenada | 0.14000 |
| 148 | South Korea | 0.17000 |
| 66 | Guinea | 0.19000 |
| 58 | Gambia | 0.21000 |
| 85 | Kenya | 0.23000 |
| 52 | Ethiopia | 0.24000 |
| 124 | Pakistan | 0.27000 |
| 47 | Egypt | 0.28000 |
| 142 | Senegal | 0.29000 |
| 69 | Haiti | 0.30000 |
| 61 | Ghana | 0.31000 |
| 82 | Japan | 0.34000 |
| 110 | Mozambique | 0.34000 |
| 103 | Mauritania | 0.41000 |
| 151 | Sri Lanka | 0.43000 |
| 67 | Guinea-Bissau | 0.45000 |
| 98 | Malawi | 0.46000 |
| 158 | Togo | 0.46000 |
| 29 | Cambodia | 0.48000 |
| 169 | Venezuela | 0.55000 |
| 14 | Bangladesh | 0.70000 |
| 136 | Rwanda | 0.76000 |
| 111 | Myanmar | 0.81000 |
| 6 | Antigua and Barbuda | 0.86000 |
Selected top 10 countries with the lowest confirmed-to-population ratio.
top10_low_risk <- low_risk_df %>%
arrange(confirmed.population.ratio) %>%
slice_head(n = 10) %>%
arrange(desc(confirmed.population.ratio))
# Create horizontal bar chart with data labels
ggplot(top10_low_risk, aes(x = reorder(country, -confirmed.population.ratio), y = confirmed.population.ratio)) +
geom_bar(stat = "identity", fill = "steelblue") +
geom_text(aes(label = round(confirmed.population.ratio, 4)),
hjust = -0.1, size = 3.5) +
coord_flip() +
labs(title = "Top 10 Countries with Lowest Confirmed Cases to Population Ratio",
x = "Country",
y = "Confirmed to Population Ratio (%)") +
theme_minimal() +
expand_limits(y = max(top10_low_risk$confirmed.population.ratio) + 0.005)
ggplot(subset,aes(x=reorder(country,confirmed),y=confirmed,fill = country))+
geom_col()+
coord_flip()+
labs(title = "highest country with confirmed cases",
x="country",
y="confirmed"
)+
theme_minimal()
In this plot Austria has the highest confirmed cases.