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

时间:2016-10-11 05:15:18

标签: r vegan

当我尝试使用install.packages("vegan")安装素食主义者并使用RStudio时,我收到以下错误消息

* 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 个答案:

答案 0 :(得分:1)

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

您可以从此处为您的操作系统下载二进制文件:

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

由于您在下载后使用的是Linux,因此可以像下面这样安装:

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

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