knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-",
  out.width = "100%"
)

Travis-CI Build Status

prenoms

The goal of prenoms is to give the names of babies born in Quebec between 1980 and 2020.

Installation

You can install prenoms from github with:

# install.packages("devtools")
devtools::install_github("desautm/prenoms")

Example 1

Here is the graph of the first names of the four members of my family, between 1980 and 2020.

library(tidyverse)
library(prenoms)
family <- prenoms %>%
  filter(
    name == "Marc-Andre" & sex == "M" |
    name == "Laurent" & sex == "M" |
    name == "Melanie" & sex == "F" |
    name == "Anna" & sex == "F"
  ) %>%
  group_by(name, year, sex) %>%
  summarise(n = sum(n)) %>%
  arrange(year)

ggplot(data = family, aes(x = year, y = n, color = name))+
  geom_line()+
  scale_x_continuous( breaks = seq(1980, 2020, by = 5))

Example 2

The five most popular female names in 2020.

prenoms %>%
  filter(year == 2020 & sex == "F") %>%
  select(year, sex, name, n) %>%
  arrange(desc(n)) %>%
  head(5)

Example 3

The five most popular male names in 2020.

prenoms %>%
  filter(year == 2020 & sex == "M") %>%
  select(year, sex, name, n) %>%
  arrange(desc(n)) %>%
  head(5)


desautm/prenoms documentation built on May 1, 2021, 3:24 a.m.