I have a categorical variable (in character structure) that is dummy coded in the following manner xx-xxxx. The first 2 digits of the dummy code are significant for categorizing the responses. I would like to be able to bin the responses according to these first 2 digits. For example, there are 28 responses dummy coded as 11-xxxx. I would like to combine all 28 of these responses into one response. I would, therefore, like to be able to convert the dummy coded categorical variable to a quantitative variable so I can more efficiently bin the responses according to these first 2 digits. Is there an R function for making this conversion?
Image of the Frequency Distribution of the first few responses for the variable
I am a beginner coder and this is my first time posting to stack overflow. Thank you for your help!