嗨,我正在使用R(在Ubuntu中为RStudio),但遇到以下问题。
我使用以下代码行:
install.packages("factoextra")
在安装过程中,我收到消息:
install.packages("factoextra")
Installing package into ‘/home/martinandrade/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependencies ‘FactoMineR’, ‘cowplot’ are not available
also installing the dependency ‘ggpubr’
trying URL 'https://cloud.r-project.org/src/contrib/ggpubr_0.2.4.tar.gz'
Content type 'application/x-gzip' length 2665439 bytes (2.5 MB)
==================================================
downloaded 2.5 MB
trying URL 'https://cloud.r-project.org/src/contrib/factoextra_1.0.5.tar.gz'
Content type 'application/x-gzip' length 1390733 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
ERROR: dependency ‘cowplot’ is not available for package ‘ggpubr’
* removing ‘/home/martinandrade/R/x86_64-pc-linux-gnu-library/3.4/ggpubr’
Warning in install.packages :
installation of package ‘ggpubr’ had non-zero exit status
ERROR: dependencies ‘FactoMineR’, ‘ggpubr’ are not available for package ‘factoextra’
* removing ‘/home/martinandrade/R/x86_64-pc-linux-gnu-library/3.4/factoextra’
Warning in install.packages :
installation of package ‘factoextra’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpsKLn56/downloaded_packages’
然后在加载程序包时会生成一条错误消息
library("factoextra")
Error in library("factoextra") : there is no package called ‘factoextra’
答案 0 :(得分:1)
cowplot和FactoMineR都要求R> = 3.5.0,而您似乎正在使用R版本3.4.0。一种可能的解决方案是使用CRAN中的最新R。或者,您可以更新到Ubuntu 19.10,该版本还提供了最新的R。如果两种方法均无法实现,则可以尝试安装所需软件包的旧版本,例如来自较旧的MRAN快照或使用remotes::install_version()
。
答案 1 :(得分:1)
对于“ car”软件包,您可以使用以下命令进行安装(在linux ubuntu上):
1)sudo apt-get更新
2)sudo apt-get install r-cran-car
答案 2 :(得分:0)
您可以安装旧版本的Cowplot。这里是一个链接: https://cran.r-project.org/src/contrib/Archive/cowplot/ 和旧版本的FactoMineR for R版本<3.5.0。 链接在这里: https://cran.r-project.org/src/contrib/Archive/FactoMineR/
答案 3 :(得分:0)
如果您仍在寻找答案,请检查您的系统上是否安装了 libcurl4-openssl-dev 软件包。
那是我缺少的部分。
答案 4 :(得分:-3)
这样做:
install.packages("factorextra")
library(factorextra)