IniziaInizia gratis

Visualizing colonialism votes

In an earlier exercise, you graphed the percentage of votes each year where the US voted "yes". Now you'll create that same graph, but only for votes related to colonialism.

Questo esercizio fa parte del corso

Case Study: Exploratory Data Analysis in R

Visualizza il corso

Istruzioni dell'esercizio

  • Load the ggplot2 package.
  • Filter the votes_joined dataset for only votes by the United States relating to colonialism, then summarize() the percentage of votes that are "yes" within each year. Name the resulting column percent_yes and save the entire data frame as US_co_by_year.
  • Add a geom_line() layer to your ggplot() call to create a line graph of the percentage of "yes" votes on colonialism (percent_yes) cast by the US over time.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Load the ggplot2 package


# Filter, then summarize by year: US_co_by_year


# Graph the % of "yes" votes over time
___(US_co_by_year, ___) ___
  ___
Modifica ed esegui il codice