Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # dataset: https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-covid-19-cases-worldwide
- library(readxl)
- library(tidyverse)
- path <- "C:/Users/brian.dill/Downloads/COVID-19-geographic-disbtribution-worldwide-2020-03-16.xls"
- covid19 <- read_excel(path)
- plotdata <- covid19 %>%
- filter(CountryExp %in% c("United States of America","Iran","Italy", "China")) %>%
- filter(DateRep > '2020-02-14') %>%
- select(DateRep, Country = CountryExp, NewConfCases, NewDeaths)
- ggplot(plotdata, aes(x = DateRep, y = NewConfCases, group = Country, color = Country))+
- geom_line() +
- labs(title = "Coronavirus Cases",
- x = "Date Reported",
- y = "# of new confirmed cases",
- subtitle = "European Centre for Disease Prevention and Control",
- linetype = "Country",
- caption = "Source: https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-covid-19-cases-worldwide")
- ggsave(filename = "C:/Users/brian.dill/Downloads/covid19.png", width = 10, height = 6, dpi = 120)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement