-3

I have been trying to load the tm text mining package onto R studio for a number of hours now. I have tried everything I have come across online but it doesnt appear to work. I started with

install.packages('tm', dependencies = TRUE)

and am given the following error

Installing package into ‘D:/Users/byrne/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependencies ‘slam’, ‘Rcampdf’, ‘Rgraphviz’, ‘Rpoppler’, ‘tm.lexicon.GeneralInquirer’ are not available
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/tm_0.6-2.zip'
Content type 'application/zip' length 710948 bytes (694 KB)
downloaded 694 KB

when i then try to load the package using

library(tm)

I get this error

Loading required package: NLP
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘slam’
Error: package or namespace load failed for ‘tm’

I have then loaded NLP and tried to load 'slam'. which it then tells me is not available on R version 3.2.3. I then updated to 3.2.5 and it still gives me the same message. I have changed the CRAN mirror to mutliple different locations and still get the same error.

Any help is greatly appreciated as I'm stumped now.

Grabdegood
  • 27
  • 1
  • 1
  • 4
  • 4
    So first you got a warning you din't read and now you have an error that you are also not reading. Read the error message, ... that's what they are for, and deal with the missing dependencies. – IRTFM Sep 12 '16 at 23:04

5 Answers5

1

It is probably that 'slam' can not be installed because of '-lgfortran' package error. You need to apply below;

  1. You need to close all R sessions also R Studio.
  2. Open terminal and type xcode-select --install
  3. Type curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
  4. Type sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /
  5. You can install 'slam' now.
ugurtemiz
  • 77
  • 1
  • 7
1

Try sudo apt-get install r-cran-slam on your terminal

It should work properly after that.

1

use command

install.packages("tm", repos="http://R-Forge.R-project.org")

David
  • 4,634
  • 7
  • 35
  • 42
0

Dependency package ‘slam’ is not available until R version 3.3.1 and you are using version 3.2.X.

Also, keep in mind that some of the dependency packages (like Rgraphviz) are no longer at the CRAN repository, but are at the Bioconductor site as explained in the answer to this question.

Community
  • 1
  • 1
ddessert
  • 53
  • 1
  • 6
0

whenever it says "there is no package called ---", just install that package, restart your r session and this time it will load fine.

  • Not always. That's essentially what the OP was doing, but was having difficulties with the dependencies – wibeasley Oct 26 '18 at 18:41