Create salary hike range
As discussed in the video, you will now classify percent_hike into the following categories for employees who are at Analyst level:
0 to 10, if 0 <=percent_hike<= 1011 to 15, if 11 <=percent_hike<= 1516 to 20, if 16 <=percent_hike<= 20
Cet exercice fait partie du cours
HR Analytics: Predicting Employee Churn in R
Instructions
- Plot a histogram of the
percent_hikecolumn. - Subset the
emp_finaldataset to contain employees atAnalystlevel and classifypercent_hikeas per the conditions mentioned above.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# 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")))