knitr::opts_chunk$set(echo = TRUE)
require(readxl)
## Loading required package: readxl
require(tidyverse)
## Loading required package: tidyverse
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.3 v purrr 0.3.4
## v tibble 3.0.6 v dplyr 1.0.4
## v tidyr 1.1.2 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
require(extrafont)
## Loading required package: extrafont
## Registering fonts with R
This is my first R-Markdown file based on covid-19 data visualization for Asian countries (Selective) in last 3 months. The saddest truth is exponentially increased the covid-19 cases as well as deaths.
Data fetched from “Our Data in World” website.
dat<-read_excel("D:/R Projects/CovidData/Covid-Asia_10May2021/owid-covid-data.xlsx")
dat1<- dat %>%
select(continent, location, date, new_cases_per_million, new_deaths_per_million)
dat2<-dat1 %>%
filter(continent=="Asia") %>%
filter(location== c("India","Nepal", "Sri Lanka","Philippines","Malaysia"))
## Warning in location == c("India", "Nepal", "Sri Lanka", "Philippines",
## "Malaysia"): longer object length is not a multiple of shorter object length
dat2$new_cases_per_million<-as.numeric(dat2$new_cases_per_million)
dat2$date<-as.Date(dat2$date)
Line Graph plotted for incidence and mortality new cases for last 3 months.
dat2 %>%
filter(date>="2021-02-10")%>%
ggplot()+
geom_smooth(aes(x=date,y=new_cases_per_million, color=location), se=FALSE)+
scale_x_date(date_labels = "%b-%Y")+
ylab("New Cases per million")+
xlab("")+
scale_color_manual(values = c("brown3", "springgreen3", "grey45","orange3","royalblue3"))+
theme_minimal()+
theme(legend.title = element_blank(),
legend.position = "bottom",
text = element_text(family="Comic Sans MS"))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
dat2 %>%
filter(date>="2021-02-10")%>%
ggplot()+
geom_smooth(aes(x=date,y=new_deaths_per_million, color=location), se=FALSE)+
scale_x_date(date_labels = "%b-%Y")+
ylab("New Deaths per million")+
xlab("")+
scale_color_manual(values = c("brown3", "springgreen3", "grey45","orange3","royalblue3"))+
theme_minimal()+
theme(legend.title = element_blank(),
legend.position = "bottom",
text = element_text(family="Comic Sans MS"))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'