The Data

This Data is sourced from Johns Hopkins University Center for Systems Science and Engineering The data has been lightly prepared and made available as a comma-separated values file (.csv)

library(dplyr)
library(lubridate)
E.Africa<-c("Kenya","Tanzania","Uganda","Rwanda")
Totals<-Covid_19_May_20%>% 
  filter(Country_Region %in% E.Africa)%>%
  group_by(Country_Region, Date,Confirmed)%>%
  summarise(count=n())
head(Totals)
## # A tibble: 6 x 4
## # Groups:   Country_Region, Date [5]
##   Country_Region Date       Confirmed count
##   <fct>          <date>         <int> <int>
## 1 Kenya          2020-03-11         1     1
## 2 Kenya          2020-03-13         1     1
## 3 Kenya          2020-03-13         3     1
## 4 Kenya          2020-03-16         3     3
## 5 Kenya          2020-03-19         7     3
## 6 Kenya          2020-03-22        15     1
library(ggplot2)
library(gganimate)
library(transformr)
library(av)
library(gifski)
library(png)
theme_set(theme_bw())
A<-Totals%>% ggplot(aes(x= Date, y= Confirmed,group= Country_Region, col= Country_Region))+ geom_line()+ggtitle("Total Covid-19 cases Confirmed East Africa as at May 21, 2020")+geom_point(size= 1.5)+xlab("Date")+ylab("Confirmed cases")
A

B<-A+transition_time(Date)+ transition_reveal(Date)
  labs(title = "day: {frame_time}")+theme_bw()+view_follow(fixed_y = TRUE)
## NULL
Covid_19_animated_EA<-animate(B, nframes = 200, renderer = gifski_renderer("covid-19_may_20.gif"))
Covid_19_animated_EA



The animated plot is showing the total number of confirmed cases by country and time.Kenya is leading in East africa with the most new infections, and with the highest rate of infection, followed by Tanzania, Rwanda and Uganda in that order.

Assessing recovery and death rate by Country
The graphs symbolize Confrimed cases, Deaths and recoveries from January through May 2020 for each country.

Cov_kenya<- Covid_19_May_20%>%
  filter(Country_Region == "Kenya") %>%
  select(Date,Confirmed, Deaths, Recovered)%>%
  arrange(Date)
 Cov_uganda<-Covid_19_May_20%>%
  filter(Country_Region == "Uganda") %>%
  select(Date,Confirmed, Deaths, Recovered)%>%
  arrange(Date)
 Cov_Tanzania<-Covid_19_May_20%>%
  filter(Country_Region == "Tanzania") %>%
  select(Date,Confirmed, Deaths, Recovered)%>%
  arrange(Date)
 Cov_Rwanda<-Covid_19_May_20%>%
  filter(Country_Region == "Rwanda") %>%
  select(Date,Confirmed, Deaths, Recovered)%>%
  arrange(Date)
library(reshape2)
Cov_ken<-melt(Cov_kenya, id.vars ="Date")
Cov_Tz<-melt(Cov_Tanzania, id.vars ="Date")
Cov_Ug<-melt(Cov_uganda, id.vars ="Date")
Cov_Rw<-melt(Cov_Rwanda, id.vars ="Date")
a<-Cov_ken %>%
  ggplot(aes(x= Date, y= value,col= variable, fill=variable))+geom_point(size=1.5)+ geom_line()+ggtitle("Covid_19 cases in Kenya by May 21, 2020")+ xlab("Date")+ ylab("Total Cases")+ theme_classic()
b<-Cov_Ug %>%
  ggplot(aes(x= Date, y= value,col= variable, fill=variable))+geom_point(size=1.5)+geom_line()+ggtitle("Covid_19 cases in Uganda by May 20, 2020")+ xlab("Date")+ ylab("Total Cases")+ theme_classic()
c<-Cov_Rw %>%
  ggplot(aes(x= Date, y= value,col= variable, fill=variable))+geom_point(size=1.5)+geom_line()+ggtitle("Covid_19 cases in Rwanda by May 20, 2020")+ xlab("Date")+ ylab("Total Cases")+ theme_classic()
d<-Cov_Tz %>%
  ggplot(aes(x= Date, y= value,col= variable, fill=variable))+geom_point(size=1.5)+geom_line()+ggtitle("Covid_19 cases Tanzania May 20")+ xlab("Date")+ ylab("Total Cases")+ theme_classic()
library(ggpubr)
ggarrange(a,b, c, d, nrow= 2, ncol=2)



From the graph, recoveries from the covid_19 disease are increasing as the number of cases increase. The recovery rate however seems lower than the infection rate. Covid_19 death rate is low as well.The situation is the same across the four countries


** Descriptives**

K<- (sum(Cov_kenya$Recovered)/sum(Cov_kenya$Confirmed))*100 
Death_rate<- (sum(Cov_kenya$Deaths)/sum(Cov_kenya$Confirmed))* 100
Ur<- (sum(Cov_uganda$Recovered)/sum(Cov_uganda$Confirmed))*100 
ud<-(sum(Cov_uganda$Deaths)/sum(Cov_uganda$Confirmed))* 100
paste( "Recovery rate in kenya is",round(K, 2), " percent" )
## [1] "Recovery rate in kenya is 29.76  percent"
paste( "Recovery rate in Uganda is",round(Ur, 2), " percent" )
## [1] "Recovery rate in Uganda is 37.1  percent"
paste("Death_rate in kenya is", round(Death_rate, 2), "percent")
## [1] "Death_rate in kenya is 4.69 percent"
paste("Death_rate in Uganda is", ud, "percent")
## [1] "Death_rate in Uganda is 0 percent"



Covid_19 Death rate seems to be lower than 5 % in East Africa. The recovery rate however too, seems to be lower than the rate at which people are getting infected. Owing to the fact that we still have no cure or vaccine, Citizens of these four countries should stick to the regulations set by their governments to manage the pandemic.