給与昇給レンジを作成する
動画で説明したとおり、Analyst レベルの従業員について percent_hike を次のカテゴリに分類します。
0 to 10: 0 <=percent_hike<= 10 の場合11 to 15: 11 <=percent_hike<= 15 の場合16 to 20: 16 <=percent_hike<= 20 の場合
この演習はコースの一部です
HRアナリティクス:Rで社員離職を予測する
演習の手順
percent_hike列のヒストグラムを作成します。emp_finalデータセットをAnalystレベルの従業員に絞り、上記の条件に従ってpercent_hikeを分類します。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Plot histogram of percent hike
ggplot(emp_final, aes(x = ___)) +
___(binwidth = 3)
# Create salary hike_range of Analyst level employees
emp_hike_range <- emp_final %>%
___(level == "___") %>%
mutate(hike_range = ___(___, breaks = c(0, 10, 15, 20),
include.lowest = TRUE,
labels = c("0 to 10",
"11 to 15", "16 to 20")))