Some summary statistics
Use dplyr
s group_by()
and summarize()
to compute summary statistics for both years.
This exercise is part of the course
Communicating with Data in the Tidyverse
Exercise instructions
- Have a look at the structure of the
ilo_data
set withstr()
. - After this, group the data by year using the
group_by()
function. - Then, calculate the mean of both variables
hourly_compensation
andworking_hours
using thesummarize()
function.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Examine the structure of ilo_data
___(ilo_data)
# Group and summarize the data
ilo_data %>%
group_by(___) %>%
___(mean_hourly_compensation = ___(___),
mean_working_hours = ___(___))