[问题] 文字探勘的stopwords

楼主: shihs (shih)   2015-07-02 17:01:02
[问题类型]:
程式咨询(我想用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) #清除停用字符
作者: Edster (Edster)   2015-07-02 19:05:00
这是哪个library, 还有你知道R中的list和字串character的差异应该就能了解那段英文的意思。
作者: penolove (丑兽的女朋友)   2015-07-03 02:24:00
unlist 应该就能解了
楼主: shihs (shih)   2015-07-08 14:30:00
是tm这个libraryunlist还是无法...错误变成是"character"

Links booklink

Contact Us: admin [ a t ] ucptt.com