Error in installing car package in R

时间:2018-02-03 09:35:20

标签: r dependencies rstudio install.packages r-car

While installing "car" package in Rstudio in Ubuntu, I faced an error saying that dependencies "nloptr","lme4" and one more, are not installed. So I started installing "nloptr" but I faced this error-

 configure: Need to download and build NLopt
 trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
 Error in download.file(url = "http://ab-initio.mit.edu/nlopt/nlopt-
 2.4.2.tar.gz",  : 
 cannot open URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
 Execution halted
 /bin/tar: This does not look like a tar archive

  gzip: stdin: unexpected end of file
  /bin/tar: Child returned status 1
  /bin/tar: Error is not recoverable: exiting now
  Warning message:
  In untar(tarfile = "nlopt-2.4.2.tar.gz") :
  '/bin/tar -xf 'nlopt-2.4.2.tar.gz'' returned error code 2
  configure: Starting to install library to 
  /tmp/RtmpSeLv7g/R.INSTALL18a67910d582/nloptr/nlopt-2.4.2
 ./configure: line 3325: cd: nlopt-2.4.2: No such file or directory

System hangs after last line and when I restart after some time, "nloptr" is not installed and hence I am unable to install "car" package. Please help me. Thanks in advance.

1 个答案:

答案 0 :(得分:0)

我在R(Linux Debian上的纯R 3.2.3)下遇到了同样的问题。我在同一个安装过程中第一次被另一个问题阻止:安装过程无法锁定目录〜/.../ R / x86_64 ... / 3.2并建议删除〜/.../ R / x86_64 ... / 3.2 / 00LOCK-nloptr。我做了,重新启动汽车包安装,然后在同一点阻止它:它需要nlopt.h。 所以,我安装了libnlopt-dev(sudo apt-get install libnlopt-dev)并重新启动汽车安装......然后就可以了。 好吧,这是在Linux下,但也许你应该专注于在Windows下安装一些关于NLOPT的东西。 祝你好运。