首页 文章

如何在R或Rstudio中安装软件包

提问于
浏览
0

在尝试安装包时:

> 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_packages'中

我不停地发出“安装警告” . 包裹安装包装......已经非零退出状态 .

What am I doing wrong? How do I Install MLR?

1 回答

  • 6

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

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

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

相关问题