dependency ‘slam’ is not available when installing

2019-01-17 03:40发布

I was able to use the library(tm) in r without problem until today, when loading tm shows:

library(tm)

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 thought this is a dependency issue and seek to reinstall package

install.packages("tm")

Warning in install.packages : dependency ‘slam’ is not available

and then try to find slam:

install.packages("slam")

Warning in install.packages :

package ‘slam’ is not available (for R version 3.2.4)

I also tried some of the issues listed here and chooseCRANmirror(), still no luck. Is there something wrong with the package or is it just that my r does not allow 'slam' to install after today?

session info

> sessionInfo()
R version 3.2.4 (2016-03-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

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

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

other attached packages:
[1] NLP_0.1-9

loaded via a namespace (and not attached):
[1] parallel_3.2.4 tools_3.2.4 

标签: r tm slam
12条回答
该账号已被封号
2楼-- · 2019-01-17 04:16

I had the same problem and:

  • I upgraded RStudio to the latest version (1.0.143)
  • I upgraded R to the latest version (R.3.3.3)
  • I rebooted Rstudio
  • I installed again in RStudio the package "tm"
  • I ran library(tm)

and everything works fine now.

查看更多
Anthone
3楼-- · 2019-01-17 04:17

I found a hint at this german site about R under Install additional R packages ("Zusätzliche R-Pakete installieren") After I installed slam seperatly over apt-get for example:

sudo apt-get install r-cran-slam

I could install tm the normal way:

install.packages('tm')

And load the library aswell.

I hope my answer helps someone.

查看更多
Root(大扎)
4楼-- · 2019-01-17 04:17
  1. Just Install NLP package with dependencies = True

  2. Install tm packaged with dependencies = True

And things should work out:)

查看更多
forever°为你锁心
5楼-- · 2019-01-17 04:18

I used the following code to install the binary or the older version of slam. It worked for me.

install.packages("slam", type = "binary")
查看更多
虎瘦雄心在
6楼-- · 2019-01-17 04:18

I am using R3.2.5. I was trying to install "tm". I did install NLP as a dependency but gave me an error :

"package ‘slam’ is not available (for R version 3.2.5)"

The option I had to was to download the zip/tar/gz file(binaries) from https://cran.r-project.org/web/packages/slam/index.html and install the package. It worked for me after that. Although I am not sure what the problem is because the library information mentions it is for R (≥ 3.3.1)

查看更多
趁早两清
7楼-- · 2019-01-17 04:24

I also had to upgrade to the most recent version of R.

Specifically, on Ubuntu 16.04 here are instructions to get the up to date R version.

查看更多
登录 后发表回答