-
-
Save EmZhu/9d7220d4e3f449135830db31abeeb131 to your computer and use it in GitHub Desktop.
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
#================================ number of gender-neutral names | |
neutral_over_year = data.frame(Year=selected_years, Count=rep(NA, length(selected_years))) | |
for (i in 1:length(selected_years)) { | |
temp_f = filtered_national %>% filter(Year==as.character(selected_years[i])) %>% filter(Gender=='F') %>% select(Name, Count) | |
temp_m = filtered_national %>% filter(Year==as.character(selected_years[i])) %>% filter(Gender=='M') %>% select(Name, Count) | |
neutral_over_year[i,2] = sum(is.na(match(temp_f$Name, temp_m$Name))=='FALSE') | |
} | |
ggplot(neutral_over_year, aes(Year, Count)) + | |
geom_line() + | |
xlim(start_year, end_year) + | |
ylim(0, round_any(max(neutral_over_year$Count), 1000, f=ceiling)) + | |
ggtitle('Number of gender-neutral baby names') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment