I am trying to split a numeric variable (Age) within the AdultUCI dataset into two groups. One that is <50 and one that is >=50. I cannot get past how to do this. I have tried a number of different things, but all of the code returns an error message.
adult[1:2,]
adult[[ "age"]] <- ordered(cut(adult[[ "age"]], c(5,25,45,65,100)),
labels = c("<50", ">=50"))