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
Este ejercicio forma parte del curso
HR Analytics: Predicting Employee Churn in R
Instrucciones del ejercicio
- Plot a histogram of the
percent_hikecolumn. - Subset the
emp_finaldataset to contain employees atAnalystlevel and classifypercent_hikeas per the conditions mentioned above.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# 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")))