Session Ready
Exercise

Comparing the Democratic lead by year

In any given year, the best way to predict the outcome of an election is to compare current polls to those in the past. If Democrats or Republicans are doing better than the other party, odds are that they're going to win the contest.

Use your data wrangling skills to assess the lead that either party had in a given year.

Instructions
100 XP
  • Use the group_by() and summarise() functions from dplyr to average the Democratic win margin in each years' polls.