CommencerCommencer gratuitement

Bringing in more data

Since overtime hours didn't have a significant change between the years, you should see what other variables you can check. In consulting with your team, somebody suggests trying engagement scores, and specifically the number of disengaged employees at the location. You don't have the survey data ready yet, so you'll need to load it in and join it to the data you've been working with. Performing multiple joins is common in HR analytics.

After the join, change year to factor(year). Since you only care about the year as a grouping variable, and not its actual numeric value, changing it to a factor will make further analysis easier.

Cet exercice fait partie du cours

HR Analytics: Exploring Employee Data in R

Afficher le cours

Instructions

  • Import "survey_data_2.csv" as survey_data using read_csv().
  • Use left_join() to add the engagement data to hr_joined. Join on year followed by employee ID.
  • Using %>% after the join, use mutate() to add disengaged, which is 1 when engagement is 2 or less, and 0 otherwise; and replace year with factor(year). Assign the result of these steps to safety.

Exercice interactif pratique

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

# Import the survey data
survey_data <- ___

# Create the safety dataset
safety <- ___

Modifier et exécuter le code