Skip to content

Instantly share code, notes, and snippets.

@apreshill
Created April 30, 2015 13:23
Show Gist options
  • Save apreshill/8e301ca77bc73c0cb91a to your computer and use it in GitHub Desktop.
Save apreshill/8e301ca77bc73c0cb91a to your computer and use it in GitHub Desktop.
Thanks to Hilary Parker for the easy breezy template!
https://gist.github.com/hilaryparker/046f55f5222b12692d74
#load packages
library(babynames)
library(dplyr)
library(ggplot2)
library(grid)
library(wesanderson)
babynames <- babynames %>% tbl_df()
#filter
alison <- babynames %>%
filter(name == "Alison" | name == "Allison" | name == "Allyson") %>%
filter(year >= 1950, sex == "F")
#plot
ggplot(alison, aes(x = year, y = prop, group = name, color = name)) +
geom_line() +
theme_bw() +
scale_colour_manual(values = wes_palette("Darjeeling"))
ggsave("alison.pdf")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment