-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog1.Rmd
312 lines (235 loc) · 14 KB
/
blog1.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
---
title: "Covid-19 in Austria"
date: "8/29/2021"
output:
html_document:
theme: journal
toc: true
toc_float: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
library(tidyverse)
library(rnaturalearth)
library(sf)
library(plotly)
library(kableExtra)
library(DT)
library(psych)
```
```{r laod data}
load(here::here("data/coronavirus.rda"))
vaccinations <- readr::read_csv(here::here("data/vaccinations.csv"))
```
# Introduction
Have you ever heard of the lyrics: "Imagine there's no countries. It isn't hard to do." from the song "Imagine" by John Lennon. It was not that difficult to imagine under the globalization before everything started in 2019. However, the world has changed since then. I believe that COVID-19 is already a familiar term to you all as it has been affecting all humankind for nearly 2 years since its outbreak, right? Due to the Pandemic, the borders had shut down one after another, the cities were locked down. The living styles had also changed a lot, such as people are working online, students are studying online which leads to a boom in online industry. Since it has been affecting us for a long period of time and it is still existing, it is necessary for us to know more about it and fight against the disaster together so as to restore the order of the world.
## What is COVID-19?
Covid-19 is an an infectious disease caused by severe acute respiratory coronavirus which have brought a pandemic to the mankind since late 2019. Up to late August, 2021, more than 200 million confirmed cases have been reported in countries and regions around the world. Meanwhile the numbers are still rising.
## What are the symptoms of COVID-19?
On average, it takes 5–6 days from someone who has infected with the virus for symptoms to show, however it can take up to 14 days. The symptoms include:
**Most common symptoms:**
- fever
- dry cough
- tiredness
**Less common symptoms:**
- aches and pains
- sore throat
- diarrhea
- conjunctivitis
- headache
- loss of taste or smell
- a rash on skin, or discoloration of fingers or toes
**Serious symptoms:**
- difficulty breathing or shortness of breath
- chest pain or pressure
- loss of speech or movement
# Overview of situation in Europe
## Total Number of confirmed cases
```{r filter data, include = FALSE}
# import data of Europe
europe <- ne_countries(continent = "europe", returnclass = "sf", scale = "medium")%>%
select(name, pop_est)
# check unmatched data
europe %>%
anti_join(coronavirus, by = c("name" = "country"))
# recode to appropriate names
europe <- europe %>%
mutate(name = recode(name,
"Bosnia and Herz." = "Bosnia and Herzegovina",
"Czech Rep." = "Czechia"))
total_cases <- coronavirus %>%
group_by(country, type, lat, long) %>%
summarise(cases = sum(cases)/1000)
# join two data sets together
europe_covid_total <- total_cases %>%
right_join(europe, by = c("country" = "name")) %>%
mutate(cases = round(cases,0)) %>%
filter(type == "confirmed")
```
```{r europe-map}
europe_map <- europe_covid_total %>%
ggplot()+
geom_sf(mapping = aes(geometry = geometry, fill = cases), size = 0.3)+
geom_text(data = europe_covid_total,aes(x= long, y = lat, label = country),color = "transparent" )+
scale_fill_distiller(palette = "Reds", na.value = "white", direction = 1)+
xlim(-20, 170)+
ylim(20, 90)+
labs(title = "Total number of cases confirmed in Europe(in 1000), updated: 8/25/2021",
fill = "") +
theme_bw()+
theme(panel.grid.major = element_line(colour = "transparent"))
ggplotly(europe_map, height = 500, width = 800) %>%
layout(xaxis = list(showticklabels = FALSE, title = ""),
yaxis = list(showticklabels = FALSE, title = ""))
```
Based on the map, it is found that, Russia, France, United Kingdom, etc have more confirmed cases compare to the others. Whereas, the Southern European and Northern European got less number of confirmed. The possible reason is that the population in this countries are lower. The map above is an <mark>**interactive map**</mark> which includes the total number of confirmed up to 8/25/2021. You can move your mouse on the map to check on the cases confirmed in each countries.
## Proportion of cases confirmed
```{r eruope-pct-cases}
pct_confirmed_cases <- total_cases %>%
inner_join(europe, by = c("country" = "name")) %>%
group_by(type, country) %>%
summarise(cases_pct = 1000*1000000*cases/pop_est) %>%
mutate(cases_pct = round(cases_pct,0))%>%
filter(type == "confirmed") %>%
ungroup() %>%
group_by(country) %>%
summarise(cases_pct = sum(cases_pct)) %>%
arrange(desc(cases_pct))
Ranking = 1:length(pct_confirmed_cases$cases_pct)
pct_confirmed_cases <- cbind(Ranking, pct_confirmed_cases)
pct_confirmed_cases %>%
kable(caption = "Total number of cofirmed cases(per 10000 population), Last updated: 8/25/2021",
align = "c",
col.names = c("Ranking","Country", "Number of confirmed")) %>%
row_spec(0, color = "white", background = "#E74C3C") %>%
row_spec(21, background = "Yellow", color = "grey") %>%
kable_styling(bootstrap_options = "striped", font_size = 12) %>%
scroll_box(width = "100%", height = "300px")
```
After adjusting the confirmed cases by population, it's a different story. From the table of **total number of confirmed cases(per 10000 population)**, it is found that some of the Northern Europeans like Sweden, Luxembourg are ranking high with the percentage of confirmed cases. Whereas, those who were having high total number of confirmed like Russia, France and Italy are ranking comparatively lower than before. While our focus country **Austria** is ranking 21/43 which is nearly the median of the European states.
<br>
# Situation in Austria
## Introduction of Austria
```{r austria-flag, out.extra='style="float:right; padding:5px"'}
knitr::include_graphics("http://98.129.95.58/public/anthems/images/Austria_flag.jpg")
```
Austria is located in Central Europe. It is bordered by the Czech Republic and Germany to the north, Slovakia and Hungary to the east, Slovenia and Italy to the south, and Switzerland and Liechtenstein to the west.
Vienna is the capital city of Austria which is always associated with music. It is a dreamland for those who are in love of classical music. Since I have learned playing piano when I was young, I have been practicing a lot of songs from the Austrian musician like Ludwig van Beethoven, Franz Joseph Haydn, Wolfgang Amadeus Mozart, etc. Austria is always where I wanted to go. And this is the reason why I am interested to study the COVID-19 situation in this country. So as to know when will we be able to enter Austria.
## Data description
There are totally two data set used in this blog. The first data set is the global cases information of the coronavirus. The second one is the status of vaccinations in European countries. Both of them were downloaded from github. The former is from [RamiKrispin's github Resitory]('https://github.com/RamiKrispin/coronavirus/blob/master/data/coronavirus.rda'). The original data is maintained by [coronavirus package]("https://CRAN.R-project.org/package=coronavirus"). Whereas the later is from [owid's githu Repository]('https://github.com/owid/covid-19-data/blob/master/public/data/vaccinations/vaccinations.csv'). The original data is maintained by [COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE)]("https://github.com/CSSEGISandData/COVID-19") at Johns Hopkins University Both of these two data sets are still updating the data, you can check on the the latest data from clicking the hyperlink above.
The raw data of **coronavirus data set** contains `r nrow(coronavirus)` rows and `r ncol(coronavirus)` columns of data. While the **vaccinations data set** contains `r nrow(vaccinations)` rows and `r ncol(vaccinations)` columns.
### Vaccinations statistics
```{r vaccine-statistics}
vaccine_type <- c("location", "iso_code", "date", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric")
vaccine_des <- describe(vaccinations) %>%
cbind(vaccine_type) %>%
mutate(mean = round(mean,2),
sd = round(sd, 2),
median = round(median,2),
trimmed = round(trimmed,2),
mad = round(mad,2),
min = round(min,2),
max = round(max,2),
range = round(range,2),
skew = round(skew,2),
kurtosis = round(kurtosis,2),
se = round(se,2))
vaccine_des <- vaccine_des[-c(1:3),]
vaccine_des %>%
mutate(vars = rep(1:11)) %>%
kable(caption = "Statistics summary of vaccination data",
align = "c", ) %>%
row_spec(0, color = "white", background = "#E74C3C") %>%
kable_styling(bootstrap_options = "striped", font_size = 12) %>%
scroll_box(width = "100%", height = "300px")
```
<br>
## Overall trend of the COVID-19 situation in Austria
### Trend on number of cases
```{r aus-daily-caes, fig.height=6, fig.width=8}
austriacovid <- coronavirus %>%
filter(country == "Austria") %>%
left_join(vaccinations, by = c("country" = "location", "date" = "date")) %>%
mutate(date = as.Date(date))
auscovid_cases <- austriacovid %>%
filter(cases >=0) %>%
ggplot(aes(x = date, y = cases)) +
geom_bar(stat = "identity", fill = "red3") +
facet_wrap(~type, ncol = 1, scales = "free_y")+
ylab("Number of cases")+
xlab("Date")+
scale_x_date(date_breaks = "60 days",date_labels = "%d-%m-%Y")+
theme_minimal()+
theme(axis.text.x = element_text(angle=20, hjust = 1))
ggplotly(auscovid_cases)
```
Based on the trend of the cases, we can see that the trend of the confirmed, death and recovery cases following the same trend. The number of cases were very low from the beginning of the cases entering the country and remained low until late September 2020. There was spark of the cases since then and the number started to drop from the early December. The possible reason was due to the season to winter when the virus is more likely to remain active.
Later on, there was decrease in the number cases when the citizens started to inject the vaccines. This indicate the effectiveness of the vaccines. However, the number increases again from late February when there was the mutant virus such as type Alpha, Beta, Gamma, Delta which are the most dangerous spread around the world. The mutant virus had faster speed of spreading and lowered the effectiveness of the vaccines caused another boom of cases to the whole world. The details are shown in the table below.
<br>
### Detailed Coronavirus cases data
```{r covid-table}
aus_covid <- coronavirus %>%
filter(country == "Austria", cases > 0) %>%
select(!province & !country & !lat & !long)
datatable(aus_covid,
filter = 'top',
class = 'vaccine',
options = list(pageLength = 5,
scrollX = TRUE,
auto_browse(TRUE),
autoWidth = TRUE))
```
[NOTE: The time range is from Jan 22, 2020 to the latest updated data on Aug 25, 2021, whereas the type includes confirmed, recovered and dead. Cases refer to the daily number of cases occur.]
<br>
### Number of daily vaccinations
```{r aus-daily-vaccine, fig.height=3, fig.width=6}
ausvaccinations <- vaccinations %>%
filter(location == "Austria") %>%
ggplot(aes(x = date,
y = daily_vaccinations))+
geom_col(fill = "red3")+
ylab("Number of daily vaccinations")+
xlab("Date")+
scale_x_date(date_breaks = "30 days",date_labels = "%d-%m-%Y")+
theme_minimal()+
theme(axis.text.x = element_text(angle=20, hjust = 1))
ggplotly(ausvaccinations, height = 400, width = 700)
```
<br>
From the bar chart above, it is found that people in Austria are quite active in injecting the vaccines. The decreasing trend from July was probably due to most of the citizens had fully injected the vaccines which had lowered the number of daily injection. The detail data is shown as follow.
### Detailed vaccination status data
```{r vaccine-table}
aus_vaccines <- vaccinations %>%
filter(location == "Austria") %>%
select(!location & !iso_code & !total_boosters & ! total_boosters_per_hundred)
datatable(aus_vaccines,
filter = 'top',
class = 'vaccine',
options = list(pageLength = 5,
scrollX = TRUE,
auto_browse(TRUE),
autoWidth = TRUE))
```
[NOTE: The time range is from 27 Dec, 2020 to the latest updated data on Aug 28, 2021]
<br>
# References
1. Information in English. (Federal Ministry, Republic of Austria). Retrieved August 28, 2021, from https://www.sozialministerium.at/en/Coronavirus/Information-in-English.html#coronavirus
2. Austria: WHO Coronavirus Disease (COVID-19) Dashboard With Vaccination Data. (WHO). Retrieved from https://covid19.who.int/region/euro/country/at
3. Rami Krispin and Jarrett Byrnes (2021). coronavirus: The 2019 Novel Coronavirus COVID-19
(2019-nCoV) Dataset. R package version 0.3.22.
https://CRAN.R-project.org/package=coronavirus
4. Wickham et al., (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43),
1686, https://doi.org/10.21105/joss.01686
5. Andy South (2017). rnaturalearth: World Map Data from Natural Earth. R package version
0.1.0. https://CRAN.R-project.org/package=rnaturalearth
6. Pebesma, E., 2018. Simple Features for R: Standardized Support for Spatial Vector Data.
The R Journal 10 (1), 439-446, https://doi.org/10.32614/RJ-2018-009
7. C. Sievert. Interactive Web-Based Data Visualization with R, plotly, and shiny. Chapman
and Hall/CRC Florida, 2020.
8. Hao Zhu (2021). kableExtra: Construct Complex Table with 'kable' and Pipe Syntax. R
package version 1.3.4. https://CRAN.R-project.org/package=kableExtra
9. Yihui Xie, Joe Cheng and Xianying Tan (2021). DT: A Wrapper of the JavaScript Library
'DataTables'. R package version 0.18. https://CRAN.R-project.org/package=DT
10. Revelle, W. (2021) psych: Procedures for Personality and Psychological Research,
Northwestern University, Evanston, Illinois, USA, https://CRAN.R-project.org/package=psych
Version = 2.1.6,.