无法在R(在我的Linux机器上)中安装脱字符包

在尝试在R中安装脱字符号包时遇到以下错误。

g++: error: /tmp/Rtmp2Tos7n/R.INSTALL2e6e30153a74/nloptr/nlopt-2.4.2/lib/libnlopt_cxx.a: No such file or directory make: *** [nloptr.so] Error 1 ERROR: compilation failed for package 'nloptr' * removing '/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/nloptr' Warning in install.packages : installation of package 'nloptr' had non-zero exit status ERROR: dependency 'nloptr' is not available for package 'lme4' * removing '/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/lme4' Warning in install.packages : installation of package 'lme4' had non-zero exit status ERROR: dependency 'lme4' is not available for package 'pbkrtest' * removing '/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/pbkrtest' Warning in install.packages : installation of package 'pbkrtest' had non-zero exit status ERROR: dependency 'lme4' is not available for package 'BradleyTerry2' * removing '/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/BradleyTerry2' Warning in install.packages : installation of package 'BradleyTerry2' had non-zero exit status ERROR: dependency 'pbkrtest' is not available for package 'car' * removing '/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/car' Warning in install.packages : installation of package 'car' had non-zero exit status ERROR: dependencies 'car', 'BradleyTerry2' are not available for package 'caret' * removing '/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/caret' Warning in install.packages : installation of package 'caret' had non-zero exit status The downloaded source packages are in '/tmp/RtmpG9dYqn/downloaded_packages' 

我研究了另一个有类似问题的问题

在R中安装脱字符号包时的依赖性问题

解决这个问题的方法是首先安装每个依赖关系,但是他们都有相同的错误信息。 例如:

 >install.packages('nloptr') g++: error: /tmp/RtmpgEn54A/R.INSTALL7015350f0d03/nloptr/nlopt-2.4.2/lib/libnlopt_cxx.a: No such file or directory make: *** [nloptr.so] Error 1 ERROR: compilation failed for package 'nloptr' * removing '/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/nloptr' Warning in install.packages : installation of package 'nloptr' had non-zero exit status The downloaded source packages are in '/tmp/RtmpG9dYqn/downloaded_packages' 

我也尝试改变repos即。 install.packages('caret', repos='http://cran.rstudio.com/')但它也可以工作。

我的会话信息如下:

 > sessionInfo() R version 3.1.2 (2014-10-31) Platform: x86_64-suse-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8 [5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 [7] LC_PAPER=en_GB.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.1.2 

很高兴如果有人可以帮助!

谢谢 :)

Solutions Collecting From Web of "无法在R(在我的Linux机器上)中安装脱字符包"

我最近遇到了nlopt的问题。 通过安装YaST(或您的首选软件包管理器)的nlopt-devel及其相关的依赖关系可以很容易地解决这个问题。

我希望先添加一条评论。 在2015年1月28日,github上的nloptr软件包中增加了一个可能会破坏汇编的程序。 我使用了一个解决方法,通过使用该命令从旧版本进行安装

 install.packages("http://cran.r-project.org/src/contrib/Archive/nloptr/nloptr_1.0.0.tar.gz", repos=NULL, type="source") 

正如在这个R帮助论坛中提到的:

http://r.789695.n4.nabble.com/can-t-install-rugarch-and-nloptr-packages-in-R-3-01-opensuse-linux-td4669649.html

将该行添加到src / Makevars文件中

  mv .libs lib; \ 

之间

  make install; \ ls | grep -v ^include$$ | grep -v ^lib$$ | xargs rm -rf; \ 

这将消除编译错误,您将能够安装nloptr软件包。 我已经测试了这个nloptr_1.0.0.tar.gz。

我通过从突触安装第一个“汽车”(使用“cran-car”过滤器)来解决这个问题。 然后我用rstudio安装“caret”,但是我想这也适用于R.希望它有帮助,关心