R: tm package reading in Newsgroups data

亡梦爱人 提交于 2019-12-11 11:18:40

问题


The lines of code below return the following error:

">"object 'readNewsgroup' not found

library(tm)
setwd("C:/Users/DanRoDuq/Downloads/20news-bydate-train")
sci.electr.train=Corpus(DirSource("sci.electronics")
,readerControl=list(reader=readNewsgroup,language="en_US"))

I got the data from: http://qwone.com/~jason/20Newsgroups/lexData.text, and downloaded the file called 20news-bydate.tar.gz

When I replace readNewsgroup by readPlain, the code runs, but the instructions I'm following tell me to use the readNewsGroup setting. Should I maybe be loading another library?


回答1:


There is no longer a reader called readNewsgroup in the current tm-Version (0.6). With getReaders() you get all available readers for your Version.

Download the same Version as the instructions you are following and there should be a readNewsgroup reader.



来源:https://stackoverflow.com/questions/26195136/r-tm-package-reading-in-newsgroups-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!