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条回答
倾城 Initia
2楼-- · 2019-01-17 03:59

The latest version of the package "slam" only works for R(>=3.4.0),so you can try either updating your R to the latest version or downloading an early version of the "slam" package.

This is a download link from CRAN for early version of "slam" package: https://cloud.r-project.org/bin/macosx/mavericks/contrib/3.3/slam_0.1-40.tgz.

查看更多
smile是对你的礼貌
3楼-- · 2019-01-17 04:07

Apparently the problem seems to be the version of R you are using. Try installing the latest version of R, 3.3.1. That should take care of it.

查看更多
走好不送
4楼-- · 2019-01-17 04:10

For R-version 3.2.3, following worked fine as mentioned in this link and it suggests this works for R-version 3.3.0 as well:

#install devtools if you have not installed 
install.packages('devtools')
library(devtools)

slam_url <- "https://cran.r-project.org/src/contrib/Archive/slam/slam_0.1-37.tar.gz"
install_url(slam_url)
查看更多
放我归山
5楼-- · 2019-01-17 04:11

I faced this error while installing the "tm" package on R version 3.3.0. Seems like some missing libraries. After I could install the latest version 3.4.1 , i was able to install the package "tm" which installed the 'slam' on its own. Hope this may help somebody.

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

I had the same problem as you.
Slam "Depends: R (≥ 3.3.1)", this why I had to perform the following actions to successfully install and load "tm" package:

  1. Update R from 3.2.5 to the latest version 3.3.2
  2. install.packages("tm")
    also installing the dependencies ‘NLP’, ‘slam’ package ‘NLP’ successfully unpacked and MD5 sums checked package ‘slam’ successfully unpacked and MD5 sums checked package ‘tm’ successfully unpacked and MD5 sums checked

  3. library(tm)

查看更多
贪生不怕死
7楼-- · 2019-01-17 04:14

For any such type of issue regarding package not installed, update your R and later reinstall the package. These are the steps you follow:

if(!require(installr)){ install.packages("installr")}

require(installr)}    #load the package

updateR()
查看更多
登录 后发表回答