Brittneys name

library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.2.3
Warning: package 'ggplot2' was built under R version 4.2.3
Warning: package 'tibble' was built under R version 4.2.3
Warning: package 'readr' was built under R version 4.2.3
Warning: package 'dplyr' was built under R version 4.2.3
Warning: package 'forcats' was built under R version 4.2.3
Warning: package 'lubridate' was built under R version 4.2.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.0
✔ purrr     1.0.1     
── 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)
Warning: package 'gt' was built under R version 4.2.3
library(babynames)
Warning: package 'babynames' was built under R version 4.2.3
library(wordcloud2)
Warning: package 'wordcloud2' was built under R version 4.2.3
babynames |>                            
  filter(year == 1994, sex == "F") |>    
  mutate(rank = row_number()) |>         
  mutate(percent = round(prop * 100, 1)) |> 
  filter(name == "Brittney") |> 
  gt()
year sex name n prop rank percent
1994 F Brittney 3876 0.00198869 89 0.2

This shows that Brittney was the 89th most popular girl name in 1994, with 3876 other babies named Brittney for about 1% of baby girls that year.

babynames |>
  filter(year == 1994) |>     # use only one year
  filter(sex == "F") |>       # use only one sex
  slice_max(prop, n=100) |>   # use the top 100 names
  select(name, n) |>          # select the two relevant variables: the name and how often it occurs
  wordcloud2(size = .5, shape = "star", color = "purple")                 # generate the word cloud

Using word art the most popular girls names in 1994 have been mapped out in the shape of a star.

babynames |>                                    # start with the data
  filter(name == "Brittney", sex == "F") |>      # choose the name and sex
  mutate(percent = round(prop * 100, 1)) |>     # create a new variable called percent
  ggplot(aes(x = year, y = percent)) +           # put year on the x-axis and prop (proportion) on y
  geom_line(color = "purple")                      # make it a line graph and give the line a color

I was born in 1994, and my name had increased in popularity about a decade before I was born, and then began to drop off in popularity about 8 years later. At its peak year, 4% of baby girls were named Brittney.

babynames |>                                  # Start with the dataset
  filter(name == "Brittney", sex == "F") |>    # only look at the name and sex you want
  slice_max(prop, n = 10)                         # get the top 10 names
# A tibble: 10 × 5
    year sex   name         n    prop
   <dbl> <chr> <chr>    <int>   <dbl>
 1  1989 F     Brittney  7832 0.00393
 2  1990 F     Brittney  7427 0.00362
 3  1988 F     Brittney  6576 0.00342
 4  1991 F     Brittney  5827 0.00287
 5  1987 F     Brittney  5129 0.00274
 6  1992 F     Brittney  5086 0.00254
 7  1986 F     Brittney  4593 0.00249
 8  1993 F     Brittney  4420 0.00224
 9  1994 F     Brittney  3876 0.00199
10  1995 F     Brittney  3380 0.00176

The peak “Brittney” year was 1989, followed by years mostly right around that same time.

babynames |>
  filter(name == "Moana" | name == "Elsa" | name == "Dory") |> 
  filter(sex == "F") |> 
  filter(year > 1980) |>
  ggplot(aes(x = year, y = n, color = name)) +
  geom_line()

It looks like Moana peaked in popularity about 1-2 years after Moana came out in 2016, and Elsa was very popular around the time the movie came out in 2013. Dory never really became popular, but the movie came out in 2003.

babynames |>
  filter(name == "Brittney" | name == "Nicole" | name == "Mashayla") |> 
  filter(sex == "F") |> 
  filter(year > 1980) |>
  ggplot(aes(x = year, y = n, color = name)) +
  geom_line()

Nicole peaked in 1985 and was much more popular than the other two names Brittney and Mashayla. With an increase of about 15,000 more people having the name Nicole at its peak than Brittney at its peak. Brittney peaked in about 1988. Mashayla never appears to peak.