简体   繁体   中英

Can not install the CRAN package `caret` on IBM Watson Studio R notebooks

While trying to install the R package caret on IBM Watson Studio R notebooks, it installs a lot of dependencies but in the end fails with non-zero exit status errors. The dependency recipes cannot be installed for some reason.

install.packages('caret')

Installing package into ‘/.../R/libs’
(as ‘lib’ is unspecified)
also installing the dependencies ‘numDeriv’, ‘SQUAREM’, ‘lava’, ‘kernlab’, ‘CVST’, ‘DEoptimR’, ‘prodlim’, ‘DRR’, ‘robustbase’, ‘sfsmisc’, ‘ipred’, ‘dimRed’, ‘lubridate’, ‘ddalpha’, ‘gower’, ‘RcppRoll’, ‘tidyselect’, ‘recipes’, ‘withr’

Warning message in install.packages("caret"):
“installation of package ‘recipes’ had non-zero exit status”Warning message in install.packages("caret"):
“installation of package ‘caret’ had non-zero exit status”

The package caret imports a lot of other R packages. One of them is recipes , which in-turn import packages like purrr , lubridate , tibble etc. Newest recipes packages seems to be relying on a mapping function called map_dfr from the purrr package which is not loaded to the namespace. Updating purrr (and maybe a list of other package) might solve the issue. I chose to go one version down on recipes and save a lot of re-installations. This worked for me:

install.packages('https://cran.r-project.org/src/contrib/Archive/recipes/recipes_0.1.0.tar.gz')
install.packages('caret')
library('caret')

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