我需要在debian stretch上运行3.6 -我遵循了这里的说明:
https://cran.r-project.org/bin/linux/debian/
并使用此repo:
http://lib.stat.cmu.edu/R/CRAN/bin/linux/debian伸缩起重机35/
我能够安装它。但是我需要的两个包,r-cran-脱和r-cran-ggplot2将不会安装:
# apt-get install r-cran-ggplot2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-cran-ggplot2 : Depends: r-api-3
Depends: r-cran-digest but it is not going to be installed
Depends: r-cran-gtable (>= 0.1.1) but it is not
going to be installed
Depends: r-cran-plyr (>= 1.7.1) but it is not going
to be installed
Depends: r-cran-reshape2 but it is not going to be installed
Depends: r-cran-scales (>= 0.4.1) but it is not
going to be installed
Depends: r-cran-tibble but it is not going to be installed
Depends: r-cran-lazyeval but it is not going to be installed
E: Unable to correct problems, you have held broken packages.有没有办法为我的环境获取这两个包?
发布于 2019-08-06 15:02:24
您缺少依赖项,apt-get会告诉您这些依赖项已损坏。您需要从您的R库中删除损坏的依赖项,该库应该在/usr/lib/R/site-library中。
为什么不直接在R中安装呢?
install.packages(c("caret", "ggplot2"), dependencies = TRUE)正如您所提到的,您希望使用docker:请参阅Dirk Eddelbuettel编写的littler包:https://github.com/eddelbuettel/littler,特别是install2.r函数及其选项-d
有关其他人如何使用它的示例,请参阅rocker docker图像。
另一个编辑:如果你决定使用littler,我想你会需要这个语法
install2.r -d TRUE caret ggplot2发布于 2019-08-06 16:27:19
我不确定这是否能解决你的问题。
sudo dpkg --configure -a在这些情况下,我发现使用aptitude更容易一些。
sudo apt install aptitude
sudo aptitude install r-cran-ggplot2当然,如果ggplot2正常工作,您也可以尝试使用插入符号。
然而,一个问题是,如果你在终端中加载R,并尝试在R中安装这些包,如果你得到任何错误消息,你会得到什么类型的错误消息?
在终端中键入R,并在它加载类型之后
install.packages("ggplot2",dependencies=TRUE)执行此操作时,您会收到什么错误消息?
另一个常见问题是,您尝试安装的包的版本确实安装在您正在使用的R版本中。在这种情况下,您必须从cran下载该包,将其解压并从本地文件安装。
打开终端并键入R,然后在会话类型中键入R
packageurl <- "https://cran.r-project.org/src/contrib/ggplot2_3.2.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source", dependencies=TRUE)如果您有版本控制的常见问题,此命令希望不会检查ggplot的版本和R的版本。
或者,如果您不想在终端中显式启动R会话类型
wget https://cran.r-project.org/src/contrib/ggplot2_3.2.0.tar.gz
R CMD INSTALL ggplot2_3.2.0.tar.gz repos=NULL type="source" dependencies=TRUEhttps://stackoverflow.com/questions/57313262
复制相似问题