R tm package invalid input in 'utf8towcs'

前端 未结 14 1402
逝去的感伤
逝去的感伤 2020-11-29 01:47

I\'m trying to use the tm package in R to perform some text analysis. I tied the following:

require(tm)
dataSet <- Corpus(DirSource(\'tmp/\'))
dataSet <         


        
14条回答
  •  情歌与酒
    2020-11-29 02:02

    I was able to fix it by converting the data back to plain text format using this line of code

    corpus <- tm_map(corpus, PlainTextDocument)

    thanks to user https://stackoverflow.com/users/4386239/paul-gowder

    for his response here

    https://stackoverflow.com/a/29529990/815677

提交回复
热议问题