library(tidyverse)
library(ggplot2)
library(cowplot)
library(patchwork)
confirmed_df <- read_csv("https://r...content-available-to-author-only...t.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv")
deaths_df <- read_csv("https://r...content-available-to-author-only...t.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv")
recovered_df <- read_csv("https://r...content-available-to-author-only...t.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv")
sd <- length(confirmed_df) - 21 # start date
ed <- length((confirmed_df)) # end date
dates <- colnames(confirmed_df[, sd:ed])
dates <- as.Date(dates,format = "%m/%d/%y")
dates <- as.POSIXct(dates,tz = "GMT")
getCountrydata <- function(Country,
dates = dates,
confirmed_df = confirmed_df,
deaths_df = deaths_df,
recovered_df = recovered_df,
sd = sd, ed = ed) {
if (Country == "all") {
cases <- confirmed_df %>%
#select(-(1:400)) %>%
select(sd:ed) %>%
colSums()
death <- deaths_df %>%
#select(-(1:400)) %>%
select(sd:ed) %>%
colSums()
recovered <- recovered_df %>%
#select(-(1:400)) %>%
select(sd:ed) %>%
colSums()
}
else {
Country <- enquo(Country)
cases <- confirmed_df %>%
filter(`Country/Region` == !! Country) %>%
#select(-(1:400)) %>%
select(sd:ed) %>%
colSums()
death <- deaths_df %>%
filter(`Country/Region` == !! Country) %>%
#select(-(1:400)) %>%
select(sd:ed) %>%
colSums()
recovered <- recovered_df %>%
filter(`Country/Region` == !! Country) %>%
#select(-(1:400)) %>%
select(sd:ed) %>%
colSums()
}
res.df <- tibble(dates,
cases = cases,
death = death,
recovery = recovered,
mortality_rate = death/cases,
recovery_rate = recovery/cases)
return(res.df)
}
world.df <- getCountrydata(Country = "all",
dates = dates,
confirmed_df = confirmed_df,
deaths_df = deaths_df,
recovered_df = recovered_df, sd, ed)
#Taiwan
taiwan.df <- getCountrydata(Country = "Taiwan*",
dates = dates,
confirmed_df = confirmed_df,
deaths_df = deaths_df,
recovered_df = recovered_df, sd, ed)
tmp.cases.plot <- function(df.plot, Country) {
df.plot %>%
mutate(cases_k = cases) %>%
ggplot( aes(x=dates, y=cases_k)) +
geom_line(color="#69b3a2") +
geom_point(color="#69b3a2", size=1) +
scale_x_datetime(breaks = world.df$dates,
date_labels = '%m/%d')+
ggtitle(paste0(Country," Evolution of COVID-19 cases")) +
ylab("cases") +
theme_cowplot() +
theme(axis.text.x = element_text(size = 10,
vjust = 0.5,
hjust = 0.5,
angle = 90))
}
tmp.deaths.plot <- function(df.plot, Country) {
df.plot %>%
ggplot( aes(x=dates, y=mortality_rate)) +
geom_line(color="#69b3a2") +
geom_point(color="#69b3a2", size=1) +
scale_x_datetime(breaks = world.df$dates,
date_labels = '%m/%d')+
ggtitle(paste0(Country," Evolution of COVID-19 death rates")) +
ylab("Mortality rates(Death/Cases)") +
theme_cowplot()+
theme(axis.text.x = element_text(size = 10,
vjust = 0.5,
hjust = 0.5,
angle = 90))
}
tmp.recover.plot <- function(df.plot, Country) {
df.plot %>%
ggplot( aes(x=dates, y=recovery_rate)) +
geom_line(color="#69b3a2") +
geom_point(color="#69b3a2", size=1) +
scale_x_datetime(breaks = world.df$dates,
date_labels = '%m/%d') +
scale_y_continuous(breaks=seq(0,1,0.2),limits = c(0,1)) +
ggtitle(paste0(Country," Evolution of COVID-19 recovery rates")) +
ylab("Recovery rates(Recovery/Cases)") +
theme_cowplot()+
theme(axis.text.x = element_text(size = 10,
vjust = 0.5,
hjust = 0.5,
angle = 90))
}
#----------
sd <- length(confirmed_df) - 22; sd
ed <- sd; ed
dates <- colnames(confirmed_df[, sd:ed])
df <- getCountrydata(Country = "Taiwan*",
dates = dates,
confirmed_df = confirmed_df,
deaths_df = deaths_df,
recovered_df = recovered_df, sd, ed)
first_data <- df$cases[[1]] ; first_data
taiwan.df['daily'] <- NA; taiwan.df
for(i in 1:nrow(taiwan.df)) {
if(i == 1)
taiwan.df$daily[i] <- taiwan.df$cases[i]- first_data
else
taiwan.df$daily[i] <- taiwan.df$cases[i]- taiwan.df$cases[i - 1]
}; tail(taiwan.df, 10)
tmp.daily.plot <- function(df.plot, Country) {
df.plot %>%
mutate(daily = daily) %>%
ggplot(aes(x = dates, y = daily)) +
geom_line(color="#69b3a2") +
geom_point(color="red", size=1) +
scale_x_datetime(breaks = world.df$dates, date_labels = '%m/%d')+
ggtitle(paste0(Country," Evolution of COVID-19 daily")) +
ylab("daily") +
theme_cowplot() +
theme(axis.text.x = element_text(size = 10,
vjust = 0.5,
hjust = 0.5,
angle = 90))
}
pic1 <- tmp.daily.plot(df.plot = taiwan.df, Country = "Taiwan"); pic1
pic2 <- tmp.cases.plot(df.plot = taiwan.df, Country = "Taiwan"); pic2
pic3 <- tmp.deaths.plot(df.plot = taiwan.df, Country = "Taiwan"); pic3
pic4 <- tmp.recover.plot(df.plot = taiwan.df, Country = "Taiwan"); pic4
pic1 + pic2 + pic3 + pic4 + plot_layout(ncol = 2)
ggplot(taiwan.df, aes(x = dates, y = taiwan$daily ))
#Bar char
ggplot(taiwan.df, aes(x = dates, y = daily)) +
geom_bar(stat = "identity", fill = "lightblue") +
scale_x_datetime(breaks = world.df$dates, date_labels = '%m/%d')
bGlicmFyeSh0aWR5dmVyc2UpCmxpYnJhcnkoZ2dwbG90MikKbGlicmFyeShjb3dwbG90KQpsaWJyYXJ5KHBhdGNod29yaykKY29uZmlybWVkX2RmIDwtIHJlYWRfY3N2KCJodHRwczovL3IuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnQuY29tL0NTU0VHSVNhbmREYXRhL0NPVklELTE5L21hc3Rlci9jc3NlX2NvdmlkXzE5X2RhdGEvY3NzZV9jb3ZpZF8xOV90aW1lX3Nlcmllcy90aW1lX3Nlcmllc19jb3ZpZDE5X2NvbmZpcm1lZF9nbG9iYWwuY3N2IikKZGVhdGhzX2RmIDwtIHJlYWRfY3N2KCJodHRwczovL3IuLi5jb250ZW50LWF2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WJibGUoZGF0ZXMsCiAgICAgICAgICAgICAgICAgICBjYXNlcyA9IGNhc2VzLAogICAgICAgICAgICAgICAgICAgZGVhdGggPSBkZWF0aCwKICAgICAgICAgICAgICAgICAgIHJlY292ZXJ5ID0gcmVjb3ZlcmVkLAogICAgICAgICAgICAgICAgICAgbW9ydGFsaXR5X3JhdGUgPSBkZWF0aC9jYXNlcywKICAgICAgICAgICAgICAgICAgIHJlY292ZXJ5X3JhdGUgPSByZWNvdmVyeS9jYXNlcykKICByZXR1cm4ocmVzLmRmKQp9CndvcmxkLmRmIDwtIGdldENvdW50cnlkYXRhKENvdW50cnkgPSAiYWxsIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0ZXMgPSBkYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybWVkX2RmID0gY29uZmlybWVkX2RmLAogICAgICAgICAgICAgICAgICAgICAgICAgICBkZWF0aHNfZGYgPSBkZWF0aHNfZGYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY292ZXJlZF9kZiA9IHJlY292ZXJlZF9kZiwgc2QsIGVkKQojVGFpd2FuCnRhaXdhbi5kZiA8LSBnZXRDb3VudHJ5ZGF0YShDb3VudHJ5ID0gIlRhaXdhbioiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0ZXMgPSBkYXRlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm1lZF9kZiA9IGNvbmZpcm1lZF9kZiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYXRoc19kZiA9IGRlYXRoc19kZiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY292ZXJlZF9kZiA9IHJlY292ZXJlZF9kZiwgc2QsIGVkKQoKdG1wLmNhc2VzLnBsb3QgPC0gZnVuY3Rpb24oZGYucGxvdCwgQ291bnRyeSkgewogIGRmLnBsb3QgJT4lCiAgICBtdXRhdGUoY2FzZXNfayA9IGNhc2VzKSAlPiUKICAgIGdncG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SkgKwogICAgeWxhYigiTW9ydGFsaXR5IHJhdGVzKERlYXRoL0Nhc2VzKSIpICsKICAgIHRoZW1lX2Nvd3Bsb3QoKSsKICAgIHRoZW1lKGF4aXMudGV4dC54ID0gZWxlbWVudF90ZXh0KHNpemUgPSAxMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZqdXN0ID0gMC41LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGp1c3QgPSAwLjUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmdsZSA9IDkwKSkgCn0KdG1wLnJlY292ZXIucGxvdCA8LSBmdW5jdGlvbihkZi5wbG90LCBDb3VudHJ5KSB7CiAgZGYucGxvdCAlPiUKICAgIGdncGxvdCggYWVzKHg9ZGF0ZXMsIHk9cmVjb3ZlcnlfcmF0ZSkpICsKICAgIGdlb21fbGluZShjb2xvcj0iIzY5YjNhMiIpICsKICAgIGdlb21fcG9pbnQoY29sb3I9IiM2OWIzYTIiLCBzaXplPTEpICsKICAgIHNjYWxlX3hfZGF0ZXRpbWUoYnJlYWtzID0gd29ybGQuZGYkZGF0ZXMsIAogICAgICAgICAgICAgICAgICAgICBkYXRlX2xhYmVscyA9ICclbS8lZCcpICsKICAgIHNjYWxlX3lfY29udGludW91cyhicmVha3M9c2VxKDAsMSwwLjIpLGxpbWl0cyA9IGMoMCwxKSkgKwogICAgZ2d0aXRsZShwYXN0ZTAoQ291bnRyeSwiIEV2b2x1dGlvbiBvZiBDT1ZJRC0xOSByZWNvdmVyeSByYXRlcyIpKSArCiAgICB5bGFiKCJSZWNvdmVyeSByYXRlcyhSZWNvdmVyeS9DYXNlcykiKSArCiAgICB0aGVtZV9jb3dwbG90KCkrCiAgICB0aGVtZShheGlzLnRleHQueCA9IGVsZW1lbnRfdGV4dChzaXplID0gMTAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2anVzdCA9IDAuNSwKICAgICAgICAgICAgIC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IKZ2dwbG90KHRhaXdhbi5kZiwgYWVzKHggPSBkYXRlcywgeSA9IGRhaWx5KSkgKyAKICAgICAgICBnZW9tX2JhcihzdGF0ID0gImlkZW50aXR5IiwgZmlsbCA9ICJsaWdodGJsdWUiKSArCiAgICAgICAgc2NhbGVfeF9kYXRldGltZShicmVha3MgPSB3b3JsZC5kZiRkYXRlcywgZGF0ZV9sYWJlbHMgPSAnJW0vJWQnKQo=