请原谅这篇文章的愚蠢性质,但我不知道如何安装 R-package 'KFAS'。我已经尝试了 command install.packages
,但这会带来以下错误消息:
> install.packages("KFAS", type = "source")
trying URL 'http://cran.cnr.berkeley.edu/src/contrib/KFAS_0.9.11.tar.gz'
Content type 'application/x-gzip' length 71845 bytes (70 Kb)
opened URL
==================================================
downloaded 70 Kb
* installing *source* package ‘KFAS’ ...
** package ‘KFAS’ successfully unpacked and MD5 sums checked
** libs
gfortran-4.2 -arch x86_64 -fno-common -g -O2 -c allsmooth.f95 -o allsmooth.o
make: gfortran-4.2: No such file or directory
make: *** [allsmooth.o] Error 1
ERROR: compilation failed for package ‘KFAS’
RMate stopped at line 0
* removing ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/KFAS’
The downloaded source packages are in
‘/private/var/folders/tm/fxjxlcfx0ld1rvd8dxztfnlh0000gn/T/RtmpZGPfzj/downloaded_packages’
Advarselsbesked:
In install.packages("KFAS", type = "source") :
installation of package ‘KFAS’ had non-zero exit status
>
现在我可以从这个错误消息中看到包管理器找不到一些 gfortran 文件或目录。由于“KFAS”包是用 R 和 Fortran 编码的,因此包管理器查找 Fortran 确实有意义。但是我刚刚安装了 gfortran,但仍然出现此错误消息。我不知道该怎么做才能让这个包自行安装。
顺便说一句,我正在使用带有 OS X Lion 的 Macbook Air。我不知道这些信息是否有帮助。如果我需要指定更多信息,请告诉我。
提前致谢