我正在尝试安装R软件包caret
这给了我ERROR: dependencies ‘ggplot2’, ‘reshape2’, ‘BradleyTerry2’ are not available for package ‘caret’
我试着分别安装其中的每一个,这再次显示了正在进行的安装,并以installation of package ‘X’ had non-zero exit status
的消息结尾
1: In install.packages("caret") :
installation of package ‘minqa’ had non-zero exit status
2: In install.packages("caret") :
installation of package ‘RcppEigen’ had non-zero exit status
3: In install.packages("caret") :
installation of package ‘scales’ had non-zero exit status
4: In install.packages("caret") :
installation of package ‘reshape2’ had non-zero exit status
5: In install.packages("caret") :
installation of package ‘lme4’ had non-zero exit status
6: In install.packages("caret") :
installation of package ‘ggplot2’ had non-zero exit status
7: In install.packages("caret") :
installation of package ‘BradleyTerry2’ had non-zero exit status
8: In install.packages("caret") :
installation of package ‘caret’ had non-zero exit status
递归地要求安装一些软件包。有什么问题吗?
我有更老的版本,在那里我遇到了类似的错误。我移除并安装了最新的。目前的版本是R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
,但仍然收到类似的错误消息。
更新
STarted with:install.packages('caret', repos='http://cran.rstudio.com/')
,它显示消息:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘minqa’, ‘RcppEigen’, ‘scales’, ‘lme4’, ‘ggplot2’, ‘reshape2’, ‘BradleyTerry2’
程序结束时:
installing to /usr/local/lib/R/site-library/reshape2/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error : package ‘stringr’ was built before R 3.0.0: please re-install it
ERROR: lazy loading failed for package ‘reshape2’
* removing ‘/usr/local/lib/R/site-library/reshape2’
ERROR: dependencies ‘minqa’, ‘RcppEigen’ are not available for package ‘lme4’
* removing ‘/usr/local/lib/R/site-library/lme4’
ERROR: dependencies ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/usr/local/lib/R/site-library/ggplot2’
ERROR: dependency ‘lme4’ is not available for package ‘BradleyTerry2’
* removing ‘/usr/local/lib/R/site-library/BradleyTerry2’
ERROR: dependencies ‘ggplot2’, ‘reshape2’, ‘BradleyTerry2’ are not available for package ‘caret’
* removing ‘/usr/local/lib/R/site-library/caret’
The downloaded source packages are in
‘/tmp/RtmpcLo8Rw/downloaded_packages’
Warning messages:
1: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘minqa’ had non-zero exit status
2: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘RcppEigen’ had non-zero exit status
3: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘scales’ had non-zero exit status
4: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘reshape2’ had non-zero exit status
5: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘lme4’ had non-zero exit status
6: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘ggplot2’ had non-zero exit status
7: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘BradleyTerry2’ had non-zero exit status
8: In install.packages("caret", repos = "http://cran.rstudio.com/") :
installation of package ‘caret’ had non-zero exit status
发布于 2016-01-07 12:56:56
在caret Documentation suggests执行install.packages("caret", dependencies = c("Depends", "Suggests"))
时,以确保安装了所有所需的包并解决所有依赖项。
发布于 2015-02-15 17:36:54
我安装插入包时也有类似的问题。我发现的问题是由更新包依赖引起的。更新一些包还会改变它们的依赖关系,而这些依赖可能没有合适的版本供以后在其他包中使用。就像我安装插入符号时一样,它显示:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called minqa?
我找到的解决方案是首先找到导致问题的包。您只需安装所需的软件包即可获得此信息。对我来说,那个是"minqa“。所以只需独立安装这个软件包。
install.packages("minqa")
我的问题就这样解决了。
对你来说,你需要一个接一个地安装“minqa”、“RcppEigen”、“scales”、“lme4 4”、“ggplot2 2”、“repe2”、“BradleyTerry2”。
发布于 2015-11-06 15:20:29
在试图在R上安装插入符号时,我遇到了类似的依赖关系问题:
> install.packages("caret", contriburl = "file:///usr/repo_AO/CRAN/")
ERROR: dependency ‘car’ is not available for package ‘caret’
> install.packages("car", contriburl = "file:///usr/repo_AO/CRAN/")
Installing package into ‘/usr/share/R/library-users’
(as ‘lib’ is unspecified)
Warning message:
package ‘car’ is not available (for R version 3.1.2)
'car' package is for >= R 3.2
> R.version
version.string R version 3.1.2 (2014-10-31)
我发现,一旦我从O.S.安装了R-car-2.0_21-1.8.x86_64.rpm包的旧版本“car”版本,“插入”就不再要求依赖关系了:
$ sudo yum install --nogpgcheck R-car-2.0_21-1.8.x86_64.rpm
Setting up Install Process
Examining R-car-2.0_21-1.8.x86_64.rpm: R-car-2.0_21-1.8.x86_64
Marking R-car-2.0_21-1.8.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package R-car.x86_64 0:2.0_21-1.8 will be installed
--> Finished Dependency Resolution
---8<---
Installed:
R-car.x86_64 0:2.0_21-1.8
Complete!
然后:
> install.packages("caret", contriburl = "file:///usr/repo_AO/CRAN/")
Installing package into ‘/usr/share/R/library-users’
(as ‘lib’ is unspecified)
also installing the dependency ‘ggplot2’
* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
----8<----
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ggplot2)
* installing *source* package ‘caret’ ...
** package ‘caret’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c caret.c -o caret.o
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o caret.so caret.o -L/usr/lib64/R/lib -lR
installing to /usr/share/R/library-users/caret/libs
----8<----
** testing if installed package can be loaded
* DONE (caret)
(*)我使用本地的储存库,因为没有直接的互联网连接,但回购地点与此无关。
https://stackoverflow.com/questions/27478328
复制相似问题