Last active
July 13, 2018 13:58
-
-
Save Torvaney/4940dde2dcf5ebbcb395b7d98c3f210f to your computer and use it in GitHub Desktop.
is both a boy and a girls name
This file contains 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
# install.packages("babynames") | |
library(babynames) | |
babynames %>% | |
filter(str_detect(name, "Hill?ary")) %>% | |
count(year, sex, wt = prop) %>% | |
ggplot(aes(x = year, y = nn)) + | |
geom_line(aes(colour = sex)) + | |
scale_y_continuous(labels = scales::percent_format()) + | |
theme_minimal() + | |
theme(legend.position = "bottom") + | |
labs(title = "Hillary + Hilary", | |
subtitle = "Proportion of babies names by gender", | |
x = "Year", | |
y = NULL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment