HRデータの結合

HR Analytics: Rで学ぶ従業員データの探索

Ben Teusch

HR Analytics Consultant

HRデータシステム

  • 従業員データ
  • 採用/ATSデータ
  • 福利厚生データ
  • 報酬データ
  • 勤怠データ
  • 給与データ
  • 業績データ
  • ... その他の部門(財務、ITなど)のデータ
HR Analytics: Rで学ぶ従業員データの探索

HRデータの結合

hr_data
 employee_id  department
           1 Engineering
           2       Sales
bonus_pay_data
 employee_id bonus_amount
           1         3000
           2        10000
left_join(hr_data, bonus_pay_data, by = "employee_id")
 employee_id  department bonus_amount
           1 Engineering         3000
           2       Sales        10000
HR Analytics: Rで学ぶ従業員データの探索

`left_join()`の使い方

hr_data
  employee_id  department
1           2 Engineering
2           3       Sales
3           4 Engineering
4           5     Finance
bonus_pay_data
  employee_id bonus_amount
1           1         3000
2           2        10000
3           3         2500
4           5         4000
left_join(hr_data, bonus_pay_data, by = "employee_id")
  employee_id  department bonus_amount
1           2 Engineering        10000
2           3       Sales         2500
3           4 Engineering           NA
4           5     Finance         4000
HR Analytics: Rで学ぶ従業員データの探索

その他の結合

他の結合の詳細については、Joining Data in R with dplyrをご参照ください。

HR Analytics: Rで学ぶ従業員データの探索

結合キーの選択

  • 結合には従業員IDなどの一意の識別子を使用する
  • 氏名の使用は避ける
HR Analytics: Rで学ぶ従業員データの探索

練習しましょう!

HR Analytics: Rで学ぶ従業員データの探索

Preparing Video For Download...