Aan de slagGa gratis aan de slag

Joining datasets with inner_join

In the first chapter, you created the votes_processed dataset, containing information about each country's votes. You'll now combine that with the new descriptions dataset, which includes topic information about each country, so that you can analyze votes within particular topics.

To do this, you'll make use of the inner_join() function from dplyr.

Deze oefening maakt deel uit van de cursus

Case Study: Exploratory Data Analysis in R

Cursus bekijken

Oefeninstructies

  • Load the dplyr package.
  • Print the votes_processed dataset.
  • Print the new descriptions dataset.
  • Join the two datasets using dplyr's inner_join(), using the rcid and session columns to match them. Save as votes_joined.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Load dplyr package


# Print the votes_processed dataset


# Print the descriptions dataset


# Join them together based on the "rcid" and "session" columns
Code bewerken en uitvoeren