I'm trying to remove some VERY special characters in my strings. i've read other post like:
but these are not what im looking for.
lets say my string is as following:
s = "who are í ½í¸€ bringing?"
i've tried following:
test = tm_map(s, function(x) iconv(enc2utf8(x), sub = "byte"))
test = iconv(s, 'UTF-8', 'ASCII')
none of above worked.
edit: I am looking for a GENERAL solution! I cannot (and prefer not) manually identify all the special characters.
also these VERY special characters MAY (not 100% sure) be result from emoticons
please help or guide me to the right posts. Thank you!
So, I'm going to go ahead and make an answer, because I believe this is what you're looking for:
Now, this does have the caveat that you have to manually define the special character in the
rmSpec
variable. Not sure if you know what special characters to remove or if you're looking for a more general solution.EDIT:
So it appears you almost had it with
iconv
, you were just missing thesub
argument. See below: