R: tm 包读取新闻组数据 [英] R: tm package reading in Newsgroups data

查看:39
本文介绍了R: tm 包读取新闻组数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的代码行返回以下错误:

The lines of code below return the following error:

">"找不到对象 'readNewsgroup'

">"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"))

我从以下位置获取数据:http://qwone.com/~jason/20Newsgroups/lexData.text,并下载名为 20news-bydate.tar.gz 的文件

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

当我用 readPlain 替换 readNewsgroup 时,代码会运行,但我遵循的说明告诉我使用 readNewsGroup 设置.我应该加载另一个库吗?

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?

推荐答案

在当前的 tm-Version (0.6) 中不再有名为 readNewsgroup 的阅读器.使用 getReaders(),您可以获得版本的所有可用阅读器.

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.

下载与您所遵循的说明相同的版本,并且应该有readNewsgroup 阅读器.

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

这篇关于R: tm 包读取新闻组数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆