Last active
December 30, 2015 10:40
-
-
Save ramnathv/6ce063236154691e8f30 to your computer and use it in GitHub Desktop.
NPR Viz Replication using ggplot2 and directlabels
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
pkgs <- list('dplyr', 'tidyr', 'ggplot2', 'readr', 'directlabels', 'ggthemes'); | |
for (pkg in pkgs) library(pkg, character.only = T) | |
read_csv("http://apps.npr.org/dailygraphics/graphics/women-cs/data.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)) | |
} %>% | |
direct.label('last.bumpup') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment