Join the two data sets together
In the video, you have learned that the inner_join() function of dplyr needs to be given a "key" on which two data frames are joined. Actually, multiple keys that need to match can be specified. In this first exercise, you are going to join two data sets by two keys. The data frames ilo_hourly_compensation and ilo_working_hours are already loaded for you and are available in your workspace.
This course touches on a lot of concepts you may have forgotten, so if you ever need a quick refresher, download the tidyverse Cheat Sheet and keep it handy!
Diese Übung ist Teil des Kurses
Communicating with Data in the Tidyverse
Anleitung zur Übung
- Combine both ILO data frames
ilo_hourly_compensationandilo_working_hoursusing theinner_join()function ofdplyr. - Join both data frames by the variables
"country"and"year".
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Join both data frames
ilo_data <- ilo_hourly_compensation %>%
___(___, by = c(___, ___))
# Count the resulting rows
ilo_data %>%
count()
# Examine ilo_data
ilo_data