user1422508
user1422508

Reputation: 109

Using R for Text Mining Reuters-21578

I am trying to do some work with the well known Reuters-21578 dataset and am having some trouble with loading the sgm files into my corpus.

Right now I am using the command

require(tm)
reut21578 <- system.file("reuters21578", package = "tm")
reuters <-Corpus(DirSource(reut21578), 
    readerControl = list(reader = readReut21578XML))

In an attempt to include all the files into my corpus but this gives me the following error:

Error in DirSource(reut21578) : empty directory

Any idea where I may be going wrong?

Upvotes: 1

Views: 4832

Answers (1)

Lenka Vran&#225;
Lenka Vran&#225;

Reputation: 1706

The "tm" package includes only sample of the Reuters21578 data. If you want to avoid downloading, loading and preparing all the 22 Reuters21578 files, you can use package "tm.corpus.Reuters21578":

install.packages("tm.corpus.Reuters21578", repos = "http://datacube.wu.ac.at")
library(tm.corpus.Reuters21578)
data(Reuters21578)

Upvotes: 6

Related Questions