4

I am using stemDocument for stemming text document using tm package in R. Example code:

data("crude")
crude[[1]]
stemDocument(crude[[1]])

I get an error message:

Error in loadNamespace(name) : there is no package called ‘Snowball’

I have installed SnowballC package and unable to find Snowball package. Below is my sessionInfo():

R version 2.15.3 (2013-03-01)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] SnowballC_0.5 tm_0.5-8.3   

loaded via a namespace (and not attached):
[1] slam_0.1-31  tools_2.15.3

Does it require any other package or Snowball?

989
  • 12,579
  • 5
  • 31
  • 53
Ram
  • 331
  • 1
  • 3
  • 11
  • 2
    You should look at [this question](http://stackoverflow.com/questions/23379961/alternatives-to-snowball-for-stemming-text-in-r?rq=1). The comments suggest that an update to `tm` may be needed. – Joe May 07 '14 at 21:03

2 Answers2

12

Just try to install the SnowballC packages to R

install.packages("SnowballC")

library(SnowballC)

It should work.

xgord
  • 4,606
  • 6
  • 30
  • 51
Manivannan Murugavel
  • 1,476
  • 17
  • 14
5

You have an older version of pkg:tm. The current version of tm has a DESCRIPTION file that lists SnowballC as a "Suggests". Older versions suggested Snowball.

Package: tm
Title: Text Mining Package
Version: 0.5-10
Date: 2014-01-07
Authors@R: c(person("Ingo", "Feinerer", role = c("aut", "cre"),
                    email = "feinerer@logic.at"),
             person("Kurt", "Hornik", role = "aut"),
             person("Artifex Software, Inc.", role = c("ctb", "cph"),
                    comment = "pdf_info.ps taken from GPL Ghostscript"))
Depends: R (>= 2.14.0)
Imports: parallel, slam (>= 0.1-31)
Suggests: filehash, proxy, Rcampdf, Rgraphviz, Rpoppler, SnowballC, XML

This is the message you currently get from CRAN:

Package ‘Snowball’ was removed from the CRAN repository.

Formerly available versions can be obtained from the archive.

Archived on 2014-03-16 at the request of the maintainer. 

You should update to the current version of tm. Try this:

update.packages("tm",  checkBuilt = TRUE)
IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • 2
    Thanks for the suggestion.That was really helpful. Updating tm package didn`t work. But updating R from 2.15.3 to 3.1 and then installing tm package & SnowballC did work. – Ram May 08 '14 at 13:55