Skip to content

Instantly share code, notes, and snippets.

@Torvaney
Last active July 13, 2018 13:58
Show Gist options
  • Save Torvaney/4940dde2dcf5ebbcb395b7d98c3f210f to your computer and use it in GitHub Desktop.
Save Torvaney/4940dde2dcf5ebbcb395b7d98c3f210f to your computer and use it in GitHub Desktop.
is both a boy and a girls name
# 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