BaşlayınÜcretsiz Başlayın

Combining HR datasets (I)

It is now time to combine datasets from various sources. Here, you will combine employee ratings with org2 using employee id as the lookup key. The rating dataset contains performance rating for the year 2013.

Performance Rating has the following levels:

  • Unacceptable
  • Below Average
  • Acceptable
  • Above Average
  • Excellent

You can use the left_join() function to join two datasets.

For example, left_join(x, y, by = "z") joins y to x. The second dataset you specify is joined to the first dataset using "z" as the lookup key.

Bu egzersiz

HR Analytics: Predicting Employee Churn in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use glimpse() to view the structure of the rating dataset.
  • Left join rating to org2 using "emp_id" as the lookup key.
  • Calculate the turnover rate for each rating level.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# View the structure of rating dataset
___

# Complete the code to join rating to org2 dataset
org3 <- ___(org2, ___, by = "emp_id")

# Calculate rating wise turnover rate
df_rating <- org3 %>% 
  ___(rating) %>% 
  ___(turnover_rating = mean(turnover))

# Check the result
df_rating
Kodu Düzenle ve Çalıştır