### USA COVID-19: Anniversary Of the First Death (Feb. 29, 2020) => http://ourworldindata.org Our World In Data * Libraries: ``` library(ggplot2) library(scales) library(forecast) library(dplyr) library(forecast) library(readr) theme_set(theme_gray()) ``` * Load Covid-19 Data for USA ``` rm(list=ls()) US <- read_csv("./DATA/owid-covid-data.csv") %>% filter(location=="United States") %>% select(date,new_cases,new_deaths,total_cases,total_deaths) ``` * Calculate 14 Day Moving Averages: Cases and Deaths ``` US$MAC <- ma(US$new_cases,14,centre = TRUE) US$MAD <- ma(US$new_deaths,14,centre = TRUE) summary(US) ``` * Plot of Daily Cases with 14 Day Moving Averages ``` US %>% filter(date >="2020-01-24") %>% ggplot() + geom_line(aes(x=date,y=new_cases,col="Daily Cases"),lwd=1) + geom_line(aes(x=date,y=MAC,col="Moving Average"),lwd=1) + labs(title="US Daily Cases w/ 14 Day Moving Average",x="Year",y="Daily Cases") + scale_y_continuous(labels=comma) ``` => https://github.com/davidjayjackson/COVID-19-uscovid19.org/blob/master/1Year-anniversary-cases.png Plot of Daily Cases * Plot of Daily Deaths with 14 Day Moving Average ``` US %>% filter(date >="2020-02-29") %>% ggplot() + geom_line(aes(x=date,y=new_deaths,col="Daily Deaths"),lwd=1) + geom_line(aes(x=date,y=MAD,col="Moving Average"),lwd=1) + labs(title="US Daily Deaths w/ 14 Day Moving Average",x="Year",y="Daily Deaths") + scale_y_continuous(labels=comma) ``` => https://github.com/davidjayjackson/COVID-19-uscovid19.org/blob/master/1Year-anniversary-deaths.png Plot of Daily Deaths * Resources: => https://youtu.be/l-DZAOYOXxM Video Walkthrough => https://github.com/davidjayjackson/COVID-19-uscovid19.org R Code and Data => https://cloud.r-project.org/ R Language and Rtools40 (click and "base" and "Rtools") => https://rstudio.com/products/rstudio/download/ Download and install RStudio => https://github.com/davidjayjackson/OWID-diet-vegetable-fruit/issues Comments, Question and Request