# creates four equal sized groups and saves it as a new variable (Height_4)
Fingers$Height_4 <- ntile(Fingers$Height, 4)
head(select(Fingers, Height, Height_4))
Example output:


Example 3:
# creates two equal sized groups
Fingers$Height_2 <- ntile(Fingers$Height, 2)
# designates the new variable as a factor and labels the group numbers
Fingers$Height_2_factor <- factor(Fingers$Height_2, levels = c(1, 2), labels = c("short", "tall"))
# check the data frame
head(select(Fingers, Height, Height_2, Height_2_factor))