Created
September 9, 2016 13:40
-
-
Save dalejbarr/a1faee4c34f23406c625d7533500c9ac to your computer and use it in GitHub Desktop.
Revisions
-
dalejbarr created this gist
Sep 9, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ library(dplyr) library(readr) library(ggplot2) dat <- read_csv("babies-first-names-all-names-all-years2.csv") # pull out babies born in 1998 dat98 <- filter(dat, yr == 1998) %>% group_by(sex) %>% filter(rank <= 5) top10 <- semi_join(dat, dat98 %>% select(sex, FirstForename), c("sex", "FirstForename")) ggplot(top10, aes(yr, number, colour = FirstForename)) + geom_line() + facet_wrap(~sex)