Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baby names 2022 #579

Open
tracykteal opened this issue Jul 9, 2023 · 1 comment
Open

Baby names 2022 #579

tracykteal opened this issue Jul 9, 2023 · 1 comment
Labels

Comments

@tracykteal
Copy link
Collaborator

We've probably done a babynames dataset before, but we could potentially do one again with the 2022 data.

https://www.ssa.gov/oact/babynames/limits.html

@tracykteal
Copy link
Collaborator Author

From @simonpcouch we can download the “National Data” which resulted in a zipped folder of .txt files, one for each year. The following script then combines them all into one data frame.

names <- list.files("~/Downloads/names", full.names = TRUE)

names_raw <-
tibble(
year = basename(names),
data = map(names, read_csv, col_names = c("name", "sex", "count"))
)

baby_names <-
names_raw %>%
mutate(year = gsub("yob", "", year),
year = gsub(".txt", "", year, fixed = TRUE),
year = as.numeric(year)) %>%
unnest(data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants