Did voters turn out?
In the United States, midterm elections typically see lower voter turnout than presidential elections. However, with so much buzz surrounding the 2018 midterm elections, turnout was expected to be higher than for previous midterm elections. Was this the case?
Your task is to create a scatterplot comparing the voter turnout (i.e. the proportion of eligible voters that cast votes) in each state between the 2014 and 2018 midterm elections.
Note that plotly
has already been loaded for you.
This exercise is part of the course
Interactive Data Visualization with plotly in R
Exercise instructions
- Create a scatterplot displaying turnout in 2014 on the x-axis and turnout in 2018 on the y-axis.
- Title the x-axis
"2014 voter turnout"
and the y-axis"2018 voter turnout"
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create a scatterplot of turnout2018 against turnout2014
turnout %>%
___ %>%
___ %>%
layout(xaxis = ___(___),
yaxis = ___(___))