Skip to content

Instantly share code, notes, and snippets.

@chasemc
Created May 13, 2020 22:23
Show Gist options
  • Save chasemc/1a6978d500aa47268ecaf9f99719af61 to your computer and use it in GitHub Desktop.
Save chasemc/1a6978d500aa47268ecaf9f99719af61 to your computer and use it in GitHub Desktop.
Is Illinois flattening, or still not testing enough?
library(data.table)
library(reshape2)
library(ggplot2)
a <- "https://covidtracking.com/api/v1/states/IL/daily.csv"
a <- data.table::fread(a)
a$date <- as.Date(as.character(a$date), "%Y%m%d")
a <- melt(a, measure.vars = c("positiveIncrease", "totalTestResultsIncrease"), id.vars="date")
a$variable <- factor(a$variable, levels = c("totalTestResultsIncrease", "positiveIncrease"))
levels(a$variable) <- c("Daily Tests", "Positive for virus")
ggplot(a, ) +
geom_point(aes(x = date, y= value, color = variable)) +
ggplot2::scale_y_log10() +
labs(color = "") +
ylab("Count (log10)") +
ggtitle("Is Illinois flattening, or still not testing enough?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment