Baby names

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(gt)
library(wordcloud2)
library(babynames)

As indicated below, my birthname was ranked 2654 in the year 1999 with only 53 girls named Josephina in the year 1999.

babynames |>                             
  filter(year == 1999) %>% 
  filter(sex == "F")   |>    
  mutate(rank = row_number()) |>         
  mutate(percent = round(prop * 100, 1)) |> 
  filter(name == "Josephina") |> 
  select(year,sex,name,n,rank,percent) %>% 
  gt()
year sex name n rank percent
1999 F Josephina 53 2654 0

Below is a wordcloud that displays the top 100 female names from the year 1999. Emily appears to be the most popular name from 1999 with Hannah following close behind.

babynames |>
  filter(year == 1999) |>     
  filter(sex == "F") |>       
  slice_max(prop, n=100) |>   
  select(name, n) |>           
  wordcloud2(size = .5)                 

The name Josephina was given increasingly over time. This was especially so during the 2000’s. The graph below displays the increase in popularity.

babynames |>                                   
  filter(name == "Josephina", sex == "F") |>      
  ggplot(aes(x = year, y = n)) +               
  geom_line(color = "blue")                                   

The table below indicates the top 10 years the name Josephina was most popular. It was most popular in the year 2016.

babynames |>                                 
  filter(name == "Josephina", sex == "F") |>   
  slice_max(prop, n = 10) %>% 
  mutate(percent = round(prop * 100, 1)) |>    
  mutate(rank = row_number()) %>% 
  gt()
year sex name n prop percent rank
2016 F Josephina 115 5.963e-05 0 1
2017 F Josephina 102 5.440e-05 0 2
2015 F Josephina 89 4.575e-05 0 3
2014 F Josephina 84 4.304e-05 0 4
2008 F Josephina 85 4.085e-05 0 5
2013 F Josephina 78 4.054e-05 0 6
2012 F Josephina 74 3.822e-05 0 7
2010 F Josephina 73 3.728e-05 0 8
2011 F Josephina 72 3.721e-05 0 9
2003 F Josephina 70 3.491e-05 0 10

Josephina remained unpopular when compared to the names Elizabeth and Helen. However, the popularity of Elizabeth and Helen have decreased over time. The graph below displays this.

babynames |>
  filter(name == "Josephina" | name == "Elizabeth" | name=="Helen") %>% 
  filter(sex == "F")  |>  
  mutate(percent = round(prop * 100, 1)) |>  
  ggplot(aes(x = year, y = percent, color = name)) +
  geom_line()

Aretha Franklin and Demi Lovato are both popular singers from different time periods. Aretha has been known to be the “Queen of Soul” and became popular during the 1960’s. The graph below displays this name also becoming more popular during her singing career. Demi Lovato became popular during the early 2000’s. The name Demi seems to also become popular during this time. The name Josephina still remains less popular in comparison. Below is a graph displaying the difference in popularity over time.

babynames |>
  filter(name == "Josephina" | name == "Aretha" | name == "Demi") |> 
  filter(sex == "F") |> 
  ggplot(aes(x = year, y = n, color = name)) +
  geom_line()