R 中的 rpart 包安装
我正在尝试在 R 中安装 "rpart" 包。但出现以下错误。
> install.packages('rpart')
Warning in install.packages("rpart") :
argument 'lib' is missing: using '/home/sandeep/R/i686-pc-linux-gnu-library/2.11'
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘rpart’ is not available
谁能告诉我错误是什么吗?怎么解决?
I am trying to install "rpart" package in R. But I am getting the following error.
> install.packages('rpart')
Warning in install.packages("rpart") :
argument 'lib' is missing: using '/home/sandeep/R/i686-pc-linux-gnu-library/2.11'
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘rpart’ is not available
Can anyone please tell whats the error about? How to solve?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
开始提示:如果您不确定是否已有软件包,您可以使用例如函数
find.package()
来检查:问题并不在于它是由默认。使用
install.packages('rpart')
可以从 CRAN 下载并安装它,没有任何问题,但是如果您检查 CRAN 上的包页面,你会看到很重要的一行:它告诉你它仅适用于 R 2.13 及以下版本。根据您的错误,我推断您仍在运行 2.11。相当多的软件包不再适用于 CRAN 的旧 R 版本,因此您最好更新您的 R。否则您会更频繁地遇到此问题。
请注意,如果您运行 Debian,则需要付出更多努力,因为 Debian 中的默认 R 总是过时的。以防万一,您可以在此处找到执行此操作的说明。
A tip to start: If you're not sure whether you have a package already, you can use eg the function
find.package()
to check:The problem is not so much that it is installed by default. It can be downloaded and installed from CRAN without problem using
install.packages('rpart')
, but if you check at the package page on CRAN, you see a very important line:which tells you that it is only available for R 2.13 and following versions. From your error, I deduce you still run 2.11. Quite some packages are not available for that old R version from CRAN any more, so you better update your R. Otherwise you'll run into this problem more often.
Be aware that if you run Debian, you'll have to do a bit more effort, as the default R in debian is always outdated. Just in case, you find the directions to do that here.
我发现,一旦重新启动 RStudio,我就能够安装该软件包,并且 find.package() 显示我现在已经拥有了这些软件包。
I found that once I restarted RStudio that I was able to install the package and find.package() showed I did, now, have the packages.