Session Ready
Exercise

A model for presidential elections

Here, you perform some quick exploratory data analysis and employ your first use of geom_text(), a geometric layer for ggplot that can be very effective for enhancing visualization.

Instructions
100 XP
  • Load the ggplot2 package and make a graph with the pres_elecs dataset.
  • Graph the pres_approve variable on the x-axis and the vote_share variable on the y-axis.
  • Set the label aesthetic to Year and add geom_text().
  • Add a linear geom_smooth() with a linear model method.