In the problem here, I have a data set of popular baby names going back to 1880. I am trying to find the timelessly popular baby names, meaning the 30 most common names for its gender in every year of my data.
I have tried using group_by, top_n, and filter, but just am not very well verse with the program yet, so unsure how the proper order and thinking goes here.
library(babynames)
timeless <- babynames %>% group_by(name, sex, year) %>% top_n(30) %>% filter()
I am getting a large data table back with the 30 most common names for each year of data, but I want to compare that to find the most common names in every year. My prof hinted that there should be four timeless boy names, and one timeless girl name. Any help is appreciated!