gpt4 book ai didi

r - 安装 ggplot2 时出错

转载 作者:行者123 更新时间:2023-12-04 09:29:23 29 4
gpt4 key购买 nike

我试图在 ggplot2 上运行一个简单的代码,但出现了以下错误:

source("u1.txt")
Error in library(ggplot2) : there is no package called ‘ggplot2’


Error : package ‘foreign’ was built before R 3.0.0: please re-install it
ERROR: lazy loading failed for package ‘maptools’
* removing ‘/home/shivangi/R/i686-pc-linux-gnu-library/3.0/maptools’
* installing *source* package ‘multcomp’ ...
** package ‘multcomp’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (multcomp)
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/shivangi/R/i686-pc-linux-gnu-library/3.0/ggplot2’

The downloaded source packages are in
‘/tmp/RtmpOGWrr4/downloaded_packages’
Warning messages:
1: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘plyr’ had non-zero exit status
3: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘testthat’ had non-zero exit status
4: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘reshape2’ had non-zero exit status
5: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘scales’ had non-zero exit status
6: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘Hmisc’ had non-zero exit status
7: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘maptools’ had non-zero exit status
8: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘ggplot2’ had non-zero exit status

最佳答案

今晚我在运行 ggplot 时遇到了同样的错误,基本上你需要尝试安装所有失败的依赖项。对我来说是“scales”,然后是“munsell”,最后是(实际问题)“colorspace”,自从我升级到 3.1.1 后就没有更新过。在您的情况下,您似乎想先尝试安装“foreign”,然后再次尝试 ggplot2。继续加载手动出错的依赖项,直到找到真正的问题。

关于r - 安装 ggplot2 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22726764/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com