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.
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) -> p3ggplotly(p3)
Then, let’s visualize female jewel names over time with prop specifically:
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:
`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.