Description Usage Format Source Examples
A database containing the first names of babies born in Ontario between 1917 and 2018. Counts of fewer than 5 names were suppressed for privacy.
1 |
A database containing 161 703 lines and 4 columns:
Year
F for female and M for male
Name
Frequency
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(dplyr)
# The five most popular girls names in Ontario in 2018
onbabynames %>%
filter(year == 2018 & sex == "F") %>%
arrange(desc(n)) %>%
head(5)
library(ggplot2)
# The popularity of the five most popular girls names in Ontario in 2018
# between 1917 and 2018
girls2018 <- onbabynames %>%
filter(year == 2018 & sex == "F") %>%
arrange(desc(n)) %>%
select(name) %>%
head(5)
onbabynames %>%
filter(name %in% girls2018$name) %>%
ggplot(aes(x = year, y = n, color = name)) +
geom_line()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.