I have a column in a dataset called debt_to_income_ratio. The first six values in the column look like this:
1. 45
2. 43
3. 20%-<30%
4. 38
5. 49
6. 50%-60%
I have been trying to remove the percentage sign from the values that are percentages. I have also been trying to find the mean of the values that are like 20%-<30% or like 50%-60%. I would like them to read 25 and 55. I used this code to try to remove the percentage sign, but it didn't work:
mutate(debt_to_income_ratio = gsub('//%','',debt_to_income_ratio))
I also am not sure how to find the average of only certain values in a column. Thanks in advance for any help!