Skip to content

Instantly share code, notes, and snippets.

@chasemc
Created June 19, 2020 20:42
Show Gist options
  • Save chasemc/2a1614d8aec8623375f484570b379662 to your computer and use it in GitHub Desktop.
Save chasemc/2a1614d8aec8623375f484570b379662 to your computer and use it in GitHub Desktop.
library(ggplot2)
library(data.table)
library(geofacet)
raw_data <- data.table::fread("http://covidtracking.com/api/states/daily.csv")
raw_data$date <- as.Date(as.character(raw_data$date), "%Y%m%d")
raw_data <- raw_data[date > "2020-03-15", ]
raw_data[positiveIncrease > 0, ] %>%
ggplot(aes(y = positiveIncrease, x=date)) +
geom_smooth()+
geom_point(alpha = .2) +
facet_geo(~state,
grid = "us_state_grid1",
label = "name",
scales = "free")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment