Hello Everyone. I have a dataset where I am analyzing social media comments for my thesis. In MySQL database, the comments contain emojis (collation: utf8mb4), but when I am importing it in Rstudio, only a question mark is showing in place of the emojis.
Dear Community. I somehow found a solution, I hope this might help someone out there.
Before retrieving data from database, run the following:
rs <- dbSendQuery(mydb, 'set character set "utf8mb4"')
then, after successfully importing dataset, run:
Encoding(clevel$comment) <- "UTF-8"
where clevel is my dataframe and comment is the comment text column.