本文介绍了安装 TM 包时依赖“slam"不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够在 r 中使用 library(tm) 直到今天没有问题,当加载 tm 显示:

图书馆(tm)

加载所需的包:NLP

loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) 中的错误:

没有名为slam"的包

错误:tm"的包或命名空间加载失败

我认为这是一个依赖问题并寻求重新安装包

install.packages("tm")

install.packages 中的警告:依赖slam"不可用

然后尝试找到slam:

install.packages("slam")

install.packages 中的警告:

'slam' 包不可用(R 版本 3.2.4)

我还尝试了列出的一些问题 herechooseCRANmirror(),仍然没有运气.软件包有问题还是只是我的 r 不允许在今天之后安装slam"?

会话信息

>会话信息()R 版本 3.2.4 (2016-03-10)平台:x86_64-apple-darwin13.4.0(64位)运行于:OS X 10.11.6 (El Capitan)语言环境:[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8附带的基础包:[1] stats graphics grDevices utils datasets 方法基础其他附加包:[1] NLP_0.1-9通过命名空间加载(而不是附加):[1] parallel_3.2.4 工具_3.2.4
解决方案

对于 R-version 3.2.3,按照此 link 并且它表明这也适用于 R-version 3.3.0 :

#install devtools 如果你还没有安装install.packages('devtools')图书馆(开发工具)slam_url <- "https://cran.r-project.org/src/contrib/Archive/slam/slam_0.1-37.tar.gz"install_url(slam_url)

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

library(tm)

I thought this is a dependency issue and seek to reinstall package

install.packages("tm")

and then try to find slam:

install.packages("slam")

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 
解决方案

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)

这篇关于安装 TM 包时依赖“slam"不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:26