ubuntu中R包安装

发布于 2024-10-31 01:57:48 字数 437 浏览 2 评论 0原文

这里有点新手。我一直在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦冥 2024-11-07 01:57:48

重新安装的过程与安装完全相同,即 install.packages("diptest")。您可能需要使用选项repos来指向正确的存储库。似乎有什么不对劲的地方。 AFAIK R 使用该版本的正确存储库,但您的安装可能会出现一些奇怪的情况。确保您按照此处在 debian 上安装 R 的说明进行操作。

因此,对于我的存储库来说:

install.packages("diptest",
   repos="http://www.freestatistics.org/cran/bin/windows/contrib/2.12")

您可以使用命令 packageStatus() 获取一些信息。这还应该为您提供存储库,例如:

> update(packageStatus())
Number of installed packages:

                         ok upgrade unavailable
  E:/R/Library          111       1           2
  C:/R/R-2.12.2/library  26       2           0

Number of available packages (each package counted only once):

                                                              installed not installed
  http://www.freestatistics.org/cran/bin/windows/contrib/2.12        99          2791
  http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.12         3            12

如果可以,您可以检查该软件包是否实际安装:

"diptest" %in% installed.packages()

如果是,您可以使用 old.packages() 检查是否可以找到更新的软件包版本。

> old.packages()
         Package    LibPath                 Installed     Built    ReposVer     
survival "survival" "E:/R/Library"          "2.36-2"      "2.12.1" "2.36-5"     
lattice  "lattice"  "C:/R/R-2.12.2/library" "0.19-17"     "2.12.2" "0.19-23"    
Matrix   "Matrix"   "C:/R/R-2.12.2/library" "0.999375-46" "2.12.2" "0.999375-49"
         Repository                                                   
survival "http://www.freestatistics.org/cran/bin/windows/contrib/2.12"
lattice  "http://www.freestatistics.org/cran/bin/windows/contrib/2.12"
Matrix   "http://www.freestatistics.org/cran/bin/windows/contrib/2.12"

如果是这样,您可以使用

install.packages("diptest")

更新所有版本

update.packages()

安装新版本,也可以使用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 :

install.packages("diptest",
   repos="http://www.freestatistics.org/cran/bin/windows/contrib/2.12")

You can get some information by using the command packageStatus(). This should also give you the repository, eg :

> update(packageStatus())
Number of installed packages:

                         ok upgrade unavailable
  E:/R/Library          111       1           2
  C:/R/R-2.12.2/library  26       2           0

Number of available packages (each package counted only once):

                                                              installed not installed
  http://www.freestatistics.org/cran/bin/windows/contrib/2.12        99          2791
  http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.12         3            12

If that is OK, you can check whether the package is actually installed :

"diptest" %in% installed.packages()

if yes, you can check with old.packages() whether you can find a newer version.

> old.packages()
         Package    LibPath                 Installed     Built    ReposVer     
survival "survival" "E:/R/Library"          "2.36-2"      "2.12.1" "2.36-5"     
lattice  "lattice"  "C:/R/R-2.12.2/library" "0.19-17"     "2.12.2" "0.19-23"    
Matrix   "Matrix"   "C:/R/R-2.12.2/library" "0.999375-46" "2.12.2" "0.999375-49"
         Repository                                                   
survival "http://www.freestatistics.org/cran/bin/windows/contrib/2.12"
lattice  "http://www.freestatistics.org/cran/bin/windows/contrib/2.12"
Matrix   "http://www.freestatistics.org/cran/bin/windows/contrib/2.12"

If that is true, you can either install a new version using

install.packages("diptest")

or just update all of them, using

update.packages()

HTH

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文