Created
May 13, 2020 22:23
-
-
Save chasemc/1a6978d500aa47268ecaf9f99719af61 to your computer and use it in GitHub Desktop.
Is Illinois flattening, or still not testing enough?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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