我遇到了同样的问题(在Windows上使用R 3.5)。
只需要继续安装缺失的依赖项,直到所有东西都被安装好(对我来说,大约有10个依赖项缺失)。
这甚至需要在找不到文件时切换到不同的镜像!
希望这能帮助将来的某个人...
> install.packages('caret', dependencies = TRUE)
> library('caret')
Loading required package: ggplot2 Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘gtable’ Error: package ‘ggplot2’ could not be loaded
> install.packages('gtable', dependencies = TRUE)
> install.packages('ggplot2', dependencies = TRUE)
> library('caret')
Error: package or namespace load failed for ‘caret’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘gower’
> install.packages('gower', dependencies = TRUE)
...