jewel_names

Popularity of jewel names over time

My project explores the popularity of jewel-inspired baby names over time, analyzing trends in how names have risen or fallen in usage across different decades.

Our first step is to load the required packages.

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ 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(babynames)
library(plotly)

Attaching package: 'plotly'

The following object is masked from 'package:ggplot2':

    last_plot

The following object is masked from 'package:stats':

    filter

The following object is masked from 'package:graphics':

    layout

Now let’s load our external data, a csv. file, taken from here:

jewels <- read_csv("jewels.csv")
Rows: 32 Columns: 3
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): Name, Category, Description

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Now we merge the two data sets together.

colnames(jewels)[1]  <- "name"

jewels |> 
  inner_join(babynames) -> jewel_names
Joining with `by = join_by(name)`

Let’s visualize the top 20 most popular jewel names children, both male and female, have been named over time:

jewel_names |> 
  group_by(name) |> 
  summarize(total = sum(n)) |> 
  arrange(desc(total)) |> 
  head(20) -> popular_jewel_names

babynames |> 
  filter(name %in% popular_jewel_names$name) |> 
  ggplot(aes(year, prop, color = name)) + geom_line() +
  facet_wrap(~sex) -> p1

ggplotly(p1)

Then, let’s visualize male jewel names over time with n specifically:

babynames |> 
  filter(name %in% popular_jewel_names$name) |> 
  filter(sex == "M") |> 
  ggplot(aes(year, n, color = name)) + geom_line() +
  facet_wrap(~sex) -> p2

ggplotly(p2)

Then, let’s visualize male jewel names over time with prop specifically:

babynames |> 
  filter(name %in% popular_jewel_names$name) |> 
  filter(sex == "M") |> 
  ggplot(aes(year, prop, color = name)) + geom_line() +
  facet_wrap(~sex) -> p2

ggplotly(p2)

Analyzing the data reveals a rise in the number of children named Jet, Onyx, and Jade in more recent years, while historically, it’s interesting to see names like Pearl and Ruby appearing as male names in earlier time periods.

Then, let’s visualize female jewel names over time with n specifically:

babynames |> 
  filter(name %in% popular_jewel_names$name) |> 
  filter(sex == "F") |> 
  ggplot(aes(year, n, color = name)) + geom_line() +
  facet_wrap(~sex) -> p3

ggplotly(p3)

Then, let’s visualize female jewel names over time with prop specifically:

babynames |> 
  filter(name %in% popular_jewel_names$name) |> 
  filter(sex == "F") |> 
  ggplot(aes(year, prop, color = name)) + geom_line() +
  facet_wrap(~sex) -> p3

ggplotly(p3)

By examining the data, we can see that names like Pearl and Ruby for females had a higher number of children given these names in their time period as there was less variability in naming trends compared to today.

Now, let’s visualize the trend of how popular jewel names are over time:

babynames |> 
  filter(name %in% popular_jewel_names$name) |> 
  ggplot(aes(year, n)) + geom_smooth() 
`geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'

Then to see if Amber had a influence on the rise in the late 1900’s let’s filter the name Amber out:

babynames |> 
  filter(name %in% popular_jewel_names$name) |> 
  filter(!name == "Amber") |> 
  ggplot(aes(year, n)) + geom_smooth()
`geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'

The name Amber played a significant role in the rise of jewel-inspired names in the late 1900s, which is fascinating to see—how a wave of Ambers helped boost the overall popularity of jewel names over time.

Overall, this project highlights how jewel-inspired names have evolved and fluctuated in popularity over time, reflecting cultural shifts, trends, and changing personal preferences in baby naming.