简体   繁体   中英

R: tm package reading in Newsgroups data

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM