A baby named Al*

About half the males in my team seem to be called Alasdair, but few of them spell it the same way. I live in hope the The International Organization for Standardization will fix the spelling, I can’t believe it hasn’t been higher up their agenda.

Anyhoo, here’s a quick post about baby names using National Records of Scotland data and a wee bit of R magic to tidy and visualise.

library(tidyverse)

df = read_csv("Downloads/babies-first-names-18-vis-final.csv")

# https://en.wikipedia.org/wiki/Alistair
var = c("Alasdair", "Alistair", "Alastair", "Allister", "Alister", "Aleister")

png("Downloads/a_baby_named_Al.png", height = 800, width = 1200)
df %>%
  gather(year, count, -firstname, -sex) %>%
  filter(sex == "Male") %>%
  filter(firstname %in% var) %>%
  mutate(year = as.numeric(year)) %>%
  ggplot(aes(year, count, colour = firstname)) +
  geom_line(lwd = 2) +
  scale_color_brewer(type = "qual", palette = "Set1") +
  labs(title = "Popularity of Al baby names",
      subtitle = "Created by Mike Spencer @mikerspencer\nNational Records of Scotland data:\nhttps://www.nrscotland.gov.uk/news/2018/most-popular-names-in-scotland",
      x = "Year",
      y = "Named babies",
      colour = "") +
  theme_bw() +
  theme(text = element_text(size = 30),
        plot.subtitle = element_text(size = 14))
dev.off()

Here’s the output!

a_baby_named_Al

1 Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s