The ozbabynames package provides the dataset ozbabynames. This contains popular Australian baby names by sex, state and year.

Installation

You can install the released version of ozbabynames from github:

Example usage

And let’s look at the popularity of the package author names, “Rob”, “Mitchell”, “Nicholas”, and “Jessie”, as well as some similar names.

author_names <- c("Robin", "Robert", "Mitchell", "Nicholas", "Jessie", "Jessica")

ozbabynames %>%
  filter(name %in% author_names) %>%
  group_by(name, year) %>% 
  summarise(count = sum(count)) %>% 
  ggplot(aes(x = year, 
             y = count,
             colour = name)) +
  geom_line() +
  theme_bw() +
  facet_wrap(~name,
             scales = "free_y") +
  theme(legend.position = "none")

And let’s see that animated

devtools::install_github('thomasp85/gganimate')
library(gganimate)

ozbabynames %>%
  filter(name %in% author_names) %>%
  count(name,year, wt = count) %>%
  ggplot(aes(x = year, 
             y = n,
             colour = name,
             group = name,
             label = name,
             fill = name)) +
  geom_line(size = 1, linetype = "dotted") +
  geom_label(colour = "white", alpha = 0.75, size =  5) +
  theme_bw() +
  theme(panel.grid = element_blank(),
        legend.position = "none",
        title = element_text(colour = "purple",
                             size = 20,
                             face = "bold")
        ) +
  labs( title = "number of bubs dubbed in {frame_along} ",
        y = "n babies" ) +
  scale_y_log10(labels = scales::comma) +
  transition_reveal(id = name, along = year) +
  enter_grow(fade = TRUE) +
  exit_shrink(fade = TRUE)

Known Issues

The coverage is very uneven, with some states only providing very recent data, and some states only providing the top 50 or 100 names. The ACT do not provide counts, and so no ACT data are included. South Australia has by far the best data, with full coverage of all names back to 1944.