0

I'm a beginner using Rstudio. I made a document corpus and I want to tidy up my text. I used these codes, but the emoji/emoticons still appear when I view the table. In my original CSV file, the emoticons look something like this: 🤷â€â™‚ï. "Could anyone help?

# create corpus object
comments_corpus<- VCorpus(DataframeSource(txt))

#create copy of corpus
reviews<-comments_corpus

#removing non english words
toSpace <- content_transformer(function(x,pattern) gsub(pattern," ",x))
reviews <- tm_map(reviews, toSpace, "[^[:alpha:]]")
reviews <- tm_map(reviews, toSpace, "[^[:alnum:]]")

I tried googling and many forms of gsub, but to no avail.

Jared Ng
  • 9
  • 1
  • You say that they emoji still show up when you "view the table". What exactly does this mean? What command are you running to view the data? It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Nov 01 '22 at 18:05

0 Answers0