CommencerCommencer gratuitement

Some summary statistics

Use dplyrs group_by() and summarize() to compute summary statistics for both years.

Cet exercice fait partie du cours

Communicating with Data in the Tidyverse

Afficher le cours

Instructions

  • Have a look at the structure of the ilo_data set with str().
  • After this, group the data by year using the group_by() function.
  • Then, calculate the mean of both variables hourly_compensation and working_hours using the summarize() function.

Exercice interactif pratique

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

# Examine the structure of ilo_data
___(ilo_data)

# Group and summarize the data
ilo_data %>%
  group_by(___) %>%
  ___(mean_hourly_compensation = ___(___),
            mean_working_hours = ___(___))
Modifier et exécuter le code