従業員の安全

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

Ben Teusch

HR Analytics Consultant

従業員の安全

なぜ安全を重視するのか?

  • 従業員への配慮
  • 離職率の低下
  • 労災費用・法的費用の削減
HR Analytics: Rで学ぶ従業員データの探索

2つのキーで結合する

accident_data
    year employee_id   accident_time
 1  2017           1         Morning
 2  2016           4       Afternoon
hr_data
    year employee_id    location
 1  2016           1   Northwood
 2  2017           1   Northwood

joined_data <- left_join(hr_data, safety_data, by = c("year", "employee_id"))

joined_data
    year employee_id    location   accident_time
 1  2016           1   Northwood            <NA>
 2  2017           1   Northwood         Morning
HR Analytics: Rで学ぶ従業員データの探索

NAの処理

joined_data
    year employee_id    location   accident_time
 1  2016           1   Northwood            <NA>
 2  2017           1   Northwood         Morning
joined_data %>%
   filter(accident_time == NA)   # no results

joined_data %>% filter(is.na(accident_time)) # use is.na() instead
     year employee_id    location  accident_type
 1   2016           1   Northwood           <NA>
HR Analytics: Rで学ぶ従業員データの探索

is.na()を使う理由

5 == 5
TRUE
NA == NA
NA
is.na(NA)
TRUE
HR Analytics: Rで学ぶ従業員データの探索

練習しましょう!

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

Preparing Video For Download...