2

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”
Sumit Goyal
  • 575
  • 3
  • 16

1 Answers1

1

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')
Sumit Goyal
  • 575
  • 3
  • 16
  • Yes, since the version of RStudio on DSX is not the current version, you usually have to go down one version on the libraries to get them if you get the non-zero issue. – Dr G. Feb 05 '18 at 15:02
  • Good to know. This question was specifically about the Jupyter R Notebooks on DSX. – Sumit Goyal Feb 05 '18 at 18:02