ubuntu中R包安装
这里有点新手。我一直在 Windows 的 R 中工作,最近搬到了 ubuntu(我认为是“Hardy Heron”)。我也不是linux人。反正。我正在尝试安装“diptest”包。我运行命令
install.packages("diptest")
,输出是:
将软件包安装到“/home/smart/R/i486-pc-linux-gnu-library/2.6”中 (因为“lib”未指定) 这有点奇怪,因为我运行的是 R 2.12.1。然后它挂起。
另外,如果我调用library("diptest"),它会说我需要重新安装该包,因为它是为 R 2.6 构建的。重新安装的过程与 install.packages
不同吗?谢谢。抱歉问这么简单的问题。
Something of a newbie here. I've been working in R for windows and have recently moved to ubuntu, ("Hardy Heron" I think). I'm also not a linux guy. Anyway. I'm tring to install the "diptest" package. I ran the command
install.packages("diptest")
and the output is:
Installing package(s) into ‘/home/smart/R/i486-pc-linux-gnu-library/2.6’
(as ‘lib’ is unspecified)
which is a little strange since I'm running R 2.12.1. And then it hangs.
Also, if I call library("diptest")
it says that I need to reinstall the package because it is built for R 2.6. Is the process for reinstalling different than install.packages
? Thanks. Sorry to ask such a simple question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重新安装的过程与安装完全相同,即 install.packages("diptest")。您可能需要使用选项
repos
来指向正确的存储库。似乎有什么不对劲的地方。 AFAIK R 使用该版本的正确存储库,但您的安装可能会出现一些奇怪的情况。确保您按照此处在 debian 上安装 R 的说明进行操作。因此,对于我的存储库来说:
您可以使用命令
packageStatus()
获取一些信息。这还应该为您提供存储库,例如:如果可以,您可以检查该软件包是否实际安装:
如果是,您可以使用
old.packages()
检查是否可以找到更新的软件包版本。如果是这样,您可以使用
install.packages("diptest")
更新所有版本
安装新版本,也可以使用HTH
Reinstalling is exactly the same procedure as installing, namely install.packages("diptest"). You might want to use the option
repos
to point to the correct repository. It seems there is going something wrong. AFAIK R uses the correct repos for the version, but it can be there's something odd going on with your installation. Make sure you followed the instructions for installing R on debian here.So for my repos that would make :
You can get some information by using the command
packageStatus()
. This should also give you the repository, eg :If that is OK, you can check whether the package is actually installed :
if yes, you can check with
old.packages()
whether you can find a newer version.If that is true, you can either install a new version using
install.packages("diptest")
or just update all of them, using
HTH