在 r 中安装素食主义者时出错

error while installing vegan in r

当我尝试使用 install.packages("vegan") 和 RStudio 安装 vegan 时,我收到以下错误消息

* 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’

您需要安装 GFortran 并确保它在您的 PATH 中。

您可以从这里为您的 OS 下载它的二进制文件:

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

因为你在 Linux 下载后你可以像这样安装它:

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

然后将其添加到您的 PATH,然后再次尝试安装 vegan