简体   繁体   中英

Caret package failed to install

I am getting this errors trying to install caret package:

ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’
Warning in install.packages :
  installation of package ‘ddalpha’ had non-zero exit status
ERROR: dependency ‘ddalpha’ is not available for package ‘recipes’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/recipes’
Warning in install.packages :
  installation of package ‘recipes’ had non-zero exit status
ERROR: dependency ‘recipes’ is not available for package ‘caret’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/caret’
Warning in install.packages :
  installation of package ‘caret’ had non-zero exit status

Any ideas?

install.packages("ddalpha")

It gives the same error:

/usr/lib64/R/library/BH/include/boost/exception/exception.hpp:137: error: expected declaration before end of line
make: *** [AlphaProcedure.o] Error 1
ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’

I have found a solution. I had the same problem. After installing caret with all its dependencies, ddalpha was not installed. Then I tried installing the package ddalpha alone. I got the message:

" There is a binary version available but the source version is later: binary source needs_compilation ddalpha 1.2.1 1.3.1 TRUE

Do you want to install from sources the package which needs compilation? y/n: n"

Well, if I anwser yes, it doesn't work. But when I answer no, it does work. It looks like the new version has some problem, but the previous one works fine.

As Roman indicated in the comments, ddalpha and recipes are dependencies that aren't installed yet. You can manually install them as follows:

install.packages(c('ddalpha', 'recipes'))

Alternatively, you can tell the install.packages() command to grab the necessary packages during the install process.

install.packages('caret', dependencies=TRUE)

Or list them explicitly:

install.packages('caret', dependencies=c('ddalpha', 'recipes'))

Or, if you use an IDE such as RStudio , the package manager that's included will automatically handle these dependencies for you.

If these suggestions don't solve the problem, you may try updating your instance of R to the latest (3.4.1 as I write this). Also, ddalpha is dependent on the Rcpp package version 0.11.0 or greater, so you may update that package.

update.packages('Rcpp')

I was facing the same issues, and I had tried almost all the methods mentioned here. But the only one that worked for me was updating my IDE and that sorted it out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM