We will use the votes_2016 data set in the gov.1005.data package to examine patterns in voting across US counties in the 2016 presidential election. You may use all our class work from Monday, and the associated code, for this problem set.

Please submit, via Canvas, two files: lastname_ps1.Rmd and lastname_ps1.html. It should be possible for us, on our own computers, to generate the second file from the first.

The problem set is due Wednesday, September 26 by 10:05 AM. Although you have two “late days” that you may use during the semester, we recommend that you save them for when you really need them.

Question 1

In each county, the Democratic (Republican) “vote share” is the number of Democratic (Republican) votes as a percentage all votes cast that county. Define the Democratic vote share margin as the Democratic vote share minus the Republican vote share. Make a scatterplot of third-party vote share — defined similarly — versus the Democratic vote share margin. Add something to the plot — faceting, color, size, animation, labeling outliers — which makes it special.

Notes

Make Your Graphics Beautiful

  • Provide clear axis labels.
  • Create a title and subtitle that describe the key result.
  • Make your legend, if you have one, informative.