无法在 IBM Watson Studio R 笔记本电脑上安装 CRAN 包“caret”

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

尝试在 IBM Watson Studio R 笔记本电脑上安装 R 包 caret 时,它安装了很多依赖项,但最终因非零退出状态错误而失败。由于某种原因无法安装依赖项 recipes

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”

caret 导入了许多其他 R 包。其中之一是 recipes,它依次导入 purrrlubridatetibble 等包。最新的 recipes 包似乎依赖于映射来自未加载到命名空间的 purrr 包中调用 map_dfr 的函数。更新 purrr(可能还有其他包的列表)可能会解决问题。我选择在 recipes 上降低一个版本并节省大量重新安装。这对我有用:

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