Popularity of Logan, Kate and Patrick

1. Track the yearly number of Kate and Patrick over the years.

Result <-
  BabyNames %>%
  filter(name %in% c("Kate", "Patrick","Logan")) %>% # just the Janes and Marys
  group_by(name, year) %>% # for each year for each name
  summarise(count = sum(count))

2. Plot out the result of (1)

Put year on the x-axis and the count of each name on the y-axis. Note that ggplot() commands use + rather than %>%.

ggplot(data=Result, aes(x = year, y = count)) +
  geom_point(aes(color=name))