error while installing vegan in r

2019-08-04 19:05发布

问题:

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.



标签: r vegan