I am working with survey data which has several variables (Questions) that asks about the quality and they reported using (1 to 5) numeric factors where (1=poor, 2=fair, 3=average, 4=good, 5=excellent). I would like to combine these factors into 3 broad categories (1&2 into 1) and (3) to 2 and (4&5) to 3. This way I have lesser dummies to make for these. I tried the (fct_collapse) this way but it does not work
library(forcats)
fct_collapse(data$quality, 1 = (2,3), 2 = (3), 3= (4,5), NULL = "NP")
I do not know if fct_collapse only works with string factors as shown here .. Cleaning up factor levels (collapsing multiple levels/labels).. or can I use it with numeric factors.