e1071 安装 R 3.1.2

Posted

技术标签:

【中文标题】e1071 安装 R 3.1.2【英文标题】:e1071 install R 3.1.2 【发布时间】:2015-02-20 01:52:59 【问题描述】:

我正在尝试在 R 3.1.2 中安装 e1071 包。我的系统是linux 3.10.0-123.13.1.el7.x86_64。我尝试使用 install.packages("e1071", type = "source") 从源代码安装,但没有帮助。有人有建议吗?

* installing *source* package 'e1071' ...
** package 'e1071' successfully unpacked and MD5 sums checked
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
** libs
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG  -I/usr/local/include    -fpic  -g -O2  -c Rsvm.c -o Rsvm.o
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG  -I/usr/local/include    -fpic  -g -O2  -c cmeans.c -o cmeans.o
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG  -I/usr/local/include    -fpic  -g -O2  -c cshell.c -o cshell.o
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG  -I/usr/local/include    -fpic  -g -O2  -c floyd.c -o floyd.o
g++ -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG  -I/usr/local/include    -fpic  -g -O2  -c svm.cpp -o svm.o
In file included from /usr/include/stdio.h:934:0,
                 from /opt/local/stow/R-3.1.2/lib64/R/include/R.h:29,
                 from svm.cpp:1:
/usr/include/bits/stdio.h: In function '__ssize_t getline(char**, size_t*, FILE*)':
/usr/include/bits/stdio.h:117:52: error: '__getdelim' was not declared in this scope
make: *** [svm.o] Error 1
ERROR: compilation failed for package 'e1071'

Warning message:
In install.packages("e1071", dep = T) :
  installation of package 'e1071' had non-zero exit status

【问题讨论】:

为什么要从源代码安装?似曾相识。你试过install.packages("e1071")吗? 【参考方案1】:

试试

sudo yum install R-devel

sudo apt-get install R-devel

第一

【讨论】:

以上是关于e1071 安装 R 3.1.2的主要内容,如果未能解决你的问题,请参考以下文章

R支持向量机模型实现

情感分析-R与spark机器学习库测试分类比较

R:在 cmeans 中实现 Mahalanobis [e1071]

R(e1071) 中是不是有直接实现多类 SVM

r: 使用库读取 libsvm 文件 (e1071)

R - SVM 训练后的奇怪错误/警告 (e1071)