I have a column contain and I wanted to remove the (*) at the end of the string but some has space in between and some has not:
Variable
0. No (1)
1. Yes(2)
2. Refuse to Answer (3)
3. Agree(4)
4. Disagree (5)
Desired outcome:
Variable
0.No
1.Yes
2.Refuse to Answer
3.Agree
4.Disagree
I want to remove the punctuation marks (), but I left the dot and removed the number inside the blanket.
I tried to do it one by one:
gsub("[[:punct:]]","",df$column)
gsub("[[:num:]]","",df$column)
but it will also remove the front part of the string. Is there any advice? thanks.