安装plyr/rcpp时出错 [英] Errors installing plyr / rcpp
问题描述
我有两台计算机,其中一台无法安装R的plyr软件包. 这是我得到的错误:
I have two computers and in one of them I can't manage to install the plyr package for R. This is the error I get:
* installing *source* package ‘plyr’ ...
** package ‘plyr’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I"/usr/lib/R/site-library/Rcpp/include" -fpic -O2 -pipe -g -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp: En la función ‘SEXPREC* plyr_loop_apply(SEXP, SEXP)’:
RcppExports.cpp:15:9: error: ‘input_parameter’ no es un miembro de ‘Rcpp::traits’
RcppExports.cpp:15:40: error: expected primary-expression before ‘int’
RcppExports.cpp:15:40: error: expected ‘;’ before ‘int’
RcppExports.cpp:16:9: error: ‘input_parameter’ no es un miembro de ‘Rcpp::traits’
RcppExports.cpp:16:49: error: expected primary-expression before ‘>’ token
RcppExports.cpp:16:50: error: ‘::type’ no se ha declarado
RcppExports.cpp:16:57: error: expected ‘;’ before ‘f’
RcppExports.cpp:17:36: error: ‘n’ no se declaró en este ámbito
RcppExports.cpp:17:39: error: ‘f’ no se declaró en este ámbito
RcppExports.cpp: En la función ‘SEXPREC* plyr_split_indices(SEXP, SEXP)’:
RcppExports.cpp:31:9: error: ‘input_parameter’ no es un miembro de ‘Rcpp::traits’
RcppExports.cpp:31:54: error: expected primary-expression before ‘>’ token
RcppExports.cpp:31:55: error: ‘::type’ no se ha declarado
RcppExports.cpp:31:62: error: expected ‘;’ before ‘group’
RcppExports.cpp:32:9: error: ‘input_parameter’ no es un miembro de ‘Rcpp::traits’
RcppExports.cpp:32:40: error: expected primary-expression before ‘int’
RcppExports.cpp:32:40: error: expected ‘;’ before ‘int’
RcppExports.cpp:33:65: error: ‘group’ no se declaró en este ámbito
RcppExports.cpp:33:72: error: ‘n’ no se declaró en este ámbito
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘plyr’
* removing ‘/home/rgalhama/R/x86_64-pc-linux-gnu-library/2.15/plyr’
Warning in install.packages :
installation of package ‘plyr’ had non-zero exit status
该软件包似乎无法编译,但我不知道为什么. 在安装开始之前,我收到以下警告消息:
It looks like the package can't be compiled, but I can't figure out why. Before the installation starts, I get this warning message:
install.packages中的警告:依赖项"Rcpp"不可用
Warning in install.packages : dependency ‘Rcpp’ is not available
我已经从系统安装了rcpp(作为sudo apt-get install r-cran-rcpp),因为我找不到从R安装它的方法:
I have installed rcpp from the system (as sudo apt-get install r-cran-rcpp), since I don't find a way to install it from R:
install.packages("Rcpp",repos =' http://cran.us.r-project .org ')将软件包安装到 ‘/home/rgalhama/R/x86_64-pc-linux-gnu-library/2.15’(因为'lib'是 未指定)install.packages中的警告:软件包"Rcpp"不是 可用(对于R版本2.15.2)
install.packages("Rcpp", repos='http://cran.us.r-project.org') Installing package(s) into ‘/home/rgalhama/R/x86_64-pc-linux-gnu-library/2.15’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘Rcpp’ is not available (for R version 2.15.2)
但是我仍然不知道这些错误是否相关.
But still I don't know if these errors are related.
有什么想法吗?
谢谢!
推荐答案
知道了!
我的解决方案是:
首先,更新R:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo sh -c "echo 'deb http://streaming.stat.iastate.edu/CRAN/bin/linux/ubuntu quantal/' >> /etc/apt/sources.list"
sudo apt-get update
sudo apt-get install r-base r-base-dev
然后从R中安装codetools软件包:
Then install codetools package from R:
install.packages("codetools")
此后,plyr
的安装顺利进行.
After this, the installation of plyr
went smoothly.
这篇关于安装plyr/rcpp时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!