error while installing vegan in r

纵饮孤独 提交于 2019-12-11 05:50:07

问题


When I tried to install vegan using install.packages("vegan") and using RStudio I am getting the following error message

* installing *source* package ‘vegan’ ...
** package ‘vegan’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fpic  -g -O2 -fstack-protector-strong  -c cepin.f -o cepin.o
/bin/bash: gfortran: command not found
/usr/lib/R/etc/Makeconf:157: recipe for target 'cepin.o' failed
make: *** [cepin.o] Error 127
ERROR: compilation failed for package ‘vegan’
* removing ‘/home/stephy/R/x86_64-pc-linux-gnu-library/3.2/vegan’
Warning in install.packages :
  installation of package ‘vegan’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpoFztoS/downloaded_packages’

回答1:


You need to install GFortran and make sure that it is in your PATH.

You can download a binary of it for your OS from here:

https://gcc.gnu.org/wiki/GFortranBinaries

Since you're on Linux after downloading it you can install it like this:

tar -xzvf gfortran-4.5-linux-i686.tar.gz -C / 

Then add it to your PATH then try installing vegan again.



来源:https://stackoverflow.com/questions/39970885/error-while-installing-vegan-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!