Remove " " using gsub

36 views Asked by At

I am using this code to remove HTML tags from the data

as.data.frame(gsub("<[^>]+>", "", ReflectionData$Answer))

But this code does not remove the "&nbsp;". The data is imported from Excel and the variable answer is a character that contains 12 options. Because of this problem, although options 11 and 14 in the picture are the same they are recognized as different levels of the character. Options recognized by my later code

How can I use gsub to get my data completely clean?

0

There are 0 answers