问题 This question already has answers here : Convert continuous numeric values to discrete categories defined by intervals (2 answers) Closed 15 days ago . everybody. I hope that you would help me to solve my query. For a vector representing the price ($) of apples say, apple <- c(23, 26, 54, 34, 34, 34, 98, 23, 4, 34, 098, 45, 93, 20, 39, 83, 78, 34, 09, 8, 56, 98, 99, 62, 29) I can assign a factor vector that represents whether it is "cheap" if apples cost less than $50 and "expensive" if apple