CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Interactive Data Visualization with plotly in R

Afficher le cours

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".

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create a scatterplot of turnout2018 against turnout2014
turnout %>%
  ___ %>%
  ___ %>%
  layout(xaxis = ___(___),
         yaxis = ___(___))
Modifier et exécuter le code