I have a data frame that contains random values between 0-60 (inclusive 0 & 60). These values denote months. I want to bin the data into three categories (x<=6, 6< x <=12, x>12) and generate a new single columns which will be a factor containing 3 values (0,1,2) denoting the respective bins.
I am able to generate 3 columns one-hot encoded style but I am unable to think of a way to generate single column having 3 factors.