I've never used split before. I would use case_when() to group:
library(tidyverse)
df <- tribble(
~age, ~ht,
25, 165,
30, 170,
35, 175,
40, 170,
45, 165
)
df <- df %>%
mutate(
age_g = case_when(
age > 35 ~ ">35",
age <= 35 ~ "<=35"
))
df
Yields:
# A tibble: 5 x 3
age ht age_g
<dbl> <dbl> <chr>
1 25 165 <=35
2 30 170 <=35
3 35 175 <=35
4 40 170 >35
5 45 165 >35
and the box plot:
df %>%
ggplot(aes(x = age_g, y = ht)) +
geom_boxplot()