Skip to content

Instantly share code, notes, and snippets.



Last active Dec 30, 2015
What would you like to do?
NPR Viz Replication using ggplot2 and directlabels
pkgs <- list('dplyr', 'tidyr', 'ggplot2', 'readr', 'directlabels', 'ggthemes');
for (pkg in pkgs) library(pkg, character.only = T)
read_csv("") %>%
mutate_each(funs(as.numeric)) %>%
gather('school', 'value', 2:5) %>%
{ggplot(data = ., aes(x = date, y = value, color = school)) +
geom_line() +
theme_minimal() +
scale_x_continuous(expand = c(0.3, 5))
} %>%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.