主数据总览
到目前为止,您已经把 rating 和 survey 数据集中的信息与原始数据集合并。
我们还在数据集 org_final 中加入了多项与员工相关的信息,例如 compensation、no_leaves_taken(已休带薪假天数)、hiring_source 等。请先查看该数据集,然后在下一章进行特征工程。
本练习是课程的一部分
HR Analytics:用 R 预测员工流失
练习说明
- 使用
glimpse()查看org_final数据集的结构。 - 将
org_final数据集中的变量数量赋值给variables。 - 生成箱线图,比较
Active与Inactive员工的distance_from_home分布。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# View the structure of the dataset
___
# Number of variables in the dataset
variables <- ___
# Compare the travel distance of Active and Inactive employees
ggplot(org_final, aes(x = ___, y = ___)) +
___