Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while installing vegan in r

Tags:

r

vegan

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’
like image 919
stephy Avatar asked Mar 26 '26 03:03

stephy


1 Answers

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.

like image 155
Hack-R Avatar answered Mar 28 '26 18:03

Hack-R



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!