Thank you. I need to replace 1 with a corresponding category.
data <- c(5, "NA", 3, 2,6)
I need to replace the values in the vector with their corresponding category names. So I need to replace all 5s, for instance, with "50 < = x < 59", and all 3s with "30 < = y < 39". But it is a long list, and it isn't convenient to go through one by one, especially because I need a generalizable solution. So I want to do the equivalent of "find and replace" but none of the R functions I have tried are working.