【问题标题】:How to install packages in R or Rstudio如何在 R 或 Rstudio 中安装包
【发布时间】:2015-06-28 20:20:09
【问题描述】:

尝试安装软件包时:

> install.packages("mlr")
Installing package into ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependencies ‘plyr’, ‘dplyr’, ‘lazyeval’ are not available
also installing the dependencies ‘scales’, ‘ggplot2’, ‘ggvis’, ‘reshape2’

trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.5.tar.gz'
Content type 'application/x-gzip' length 56346 bytes (55 Kb)
opened URL
==================================================
downloaded 55 Kb

trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb

trying URL 'http://cran.rstudio.com/src/contrib/ggvis_0.4.2.tar.gz'
Content type 'application/x-gzip' length 728345 bytes (711 Kb)
opened URL
==================================================
downloaded 711 Kb

trying URL 'http://cran.rstudio.com/src/contrib/reshape2_1.4.1.tar.gz'
Content type 'application/x-gzip' length 34693 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb

trying URL 'http://cran.rstudio.com/src/contrib/mlr_2.4.tar.gz'
Content type 'application/x-gzip' length 440988 bytes (430 Kb)
opened URL
==================================================
downloaded 430 Kb

ERROR: dependency ‘plyr’ is not available for package ‘scales’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/scales’
Warning in install.packages :
  installation of package ‘scales’ had non-zero exit status
ERROR: dependencies ‘dplyr’, ‘lazyeval’ are not available for package ‘ggvis’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/ggvis’
Warning in install.packages :
  installation of package ‘ggvis’ had non-zero exit status
ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
Warning in install.packages :
  installation of package ‘reshape2’ had non-zero exit status
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’
Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependencies ‘ggplot2’, ‘ggvis’, ‘plyr’, ‘reshape2’ are not available for package ‘mlr’
  • 删除“/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/mlr” install.packages 中的警告: 安装包“mlr”的退出状态非零

下载的源码包在 '/tmp/Rtmp3AjleG/downloaded_pa​​ckages'

我在 install.packages insallation of package 中不断收到“错误”警告..​​.退出状态不为零。

我做错了什么?如何安装 MLR?

【问题讨论】:

  • 在安装 mlr 之前尝试安装‘plyr’、‘dplyr’、‘lazyeval’。
  • > install.packages('plyr') 将包安装到 '/home/kisco/R/x86_64-pc-linux-gnu-library/3.0' (因为 'lib' 未指定) 警告install.packages : 包 'plyr' 不可用(对于 R 版本 3.0.2)
  • 我今天安装“plyr”时也出错。尝试重新启动 R/Rstudio,它对我有用。
  • 更新R怎么样?最新版本是R-3.2.1。
  • 根据您的错误消息,您使用的是Rversion 3.0.2。我认为按照cran.r-project.org 上的说明更新 R- 3.2.1 可能会有所帮助。您使用 apt-get 获得的版本不一定是最新版本。

标签: r installation package failed-installation


【解决方案1】:

你有一个过时的 R 版本。通常dplyr 和你的其他依赖项会被自动安装,但在这种情况下,它们被标记为不适用于旧版本的 R,所以抛出一个错误。

您的版本 3.0.2 已过期。截至目前,当前版本为 3.2.1。您应该升级(您没有最新版本的 r-base,repos 经常落后 - 尝试从 here 获取二进制文件)。

如果您不想更新,可以使用此问题的答案中描述的方法来安装可能与您的版本兼容的旧版本的软件包 - install older version of R package。

【讨论】:

  • 谢谢!除了您的建议,我还必须这样做:stackoverflow.com/a/10260634/117700
  • 但是,我仍然不明白这个巨型是什么 n -Iicu55/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -UDEBUG -DNDEBUG -DU_HAVE_ELF_H -fpic -g -O2 -fstack-protector --param =ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c stri_brkiter.cpp -o stri_brkiter.o g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -我。 -Iicu55 -Iicu55/
  • 一些包是在安装时从源代码编译的(主要是通过 Rcpp 使用 c++ 代码时),您可以在控制台中获得编译器输出。如果不是错误,您通常可以放心地忽略它。
猜你喜欢
  • 2020-03-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-18
  • 2015-03-14
  • 1970-01-01
  • 2021-02-06
  • 2014-10-30
相关资源
最近更新 更多