직원 안전

HR Analytics: R로 살펴보는 직원 데이터

Ben Teusch

HR Analytics Consultant

직원 안전

왜 안전에 집중해야 할까요?

  • 직원 보호
  • 이직률 감소
  • 산재 비용 및 법적 비용 절감
HR Analytics: R로 살펴보는 직원 데이터

두 개의 키로 조인하기

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...