[問題] 文字探勘的stopwords
[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
入門(寫過其他程式,只是對語法不熟悉)
[問題敘述]:
我想要用R做text mining,但在stopwords這個步驟的時候出錯
Error in UseMethod("tm_map", x) :
no applicable method for 'tm_map' applied to an object of class "list"
[程式範例]:
#讀進一個檔案
data = readLines("test/test.txt")
#進行中文斷詞
insertWords(toTrad(iconv(c("民進黨"), "big5", "UTF-8"), rev=TRUE))#增加詞彙
segment.options(isNameRecognition = TRUE)#增加人名辨識
#將文章分詞
data.seg = segmentCN(data, nature=FALSE)
#stop words
myStopWords = toTrad(stopwordsCN())
data.seg= tm_map(data.seg, removeWords, myStopWords) #清除停用字符
----------->最後一步出現Error in UseMethod("tm_map", x) :
no applicable method for 'tm_map' applied to an object of class "list"
[環境敘述]:
R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.218.5.190
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1435827664.A.77D.html
推
07/02 19:05, , 1F
07/02 19:05, 1F
→
07/02 19:06, , 2F
07/02 19:06, 2F
推
07/03 02:24, , 3F
07/03 02:24, 3F
→
07/08 14:30, , 4F
07/08 14:30, 4F
→
07/08 14:31, , 5F
07/08 14:31, 5F
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章