R-invalid multibyte string 1

I'm new to R software

Now, learning about word processing using the tm package

I have ploblem when displaying text in lowercase

sms_raw<-read.csv(............)
sms_corpus<-Corpus(VectorSource(sms_raw$text)) 
sms_corpus<-Corpus(VectorSource(sms_raw$text))  
tm_map(sms_corpus,content_transformer(tolower))   
error:invalid multubytes string 1

I thought my csv file could not be utf-8, so I restored it as utf-8, but it did not work.

my OS is win8.1

Does anyone have a solution on this issue, please let me know.

+4
source share
1 answer

An error that I easily solved using the encoding function

The file column whose name contains text contains a multibyte character

So i type

sms_raw$text <- iconv(enc2utf8(sms_raw$text),sub="byte")

This command converts the text column (multibyte) to utf8

+15

All Articles