我正在尝试安装ggplot2包,以便为我的图形使用ggplot函数,但它总是失败。问题出在哪里?
> install.packages("ggplot2")
Installing package into ‘C:/Users/Augustinho/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
ggplot2 3.3.0 3.3.1 FALSE
installing the source package ‘ggplot2’
trying URL 'https://cran.stat.unipd.it/src/contrib/ggplot2_3.3.1.tar.gz'
Content type 'application/octet-stream' length 3035612 bytes (2.9 MB)
downloaded 2.9 MB
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error : .onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: package 'vctrs' not found
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/Augustinho/Documents/R/win-library/3.5/ggplot2'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Users\Augustinho\AppData\Local\Temp\RtmpM7MaYn\downloaded_packages’
Warning messages:
1: In readRDS(dest) : lzma decoding result 10
2: In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’发布于 2020-06-20 22:09:33
由于您使用的是Windows,因此请尝试安装带有依赖项的二进制版本:
install.packages("ggplot2",
type = "binary",
dependencies = TRUE,
repos = "https://cloud.r-project.org")编辑:
帮助第一次运行:
install.packages("vctrs", type = "binary", dependencies = TRUE, repos = "https://cloud.r-project.org")跳过一些vctrs安装错误。
https://stackoverflow.com/questions/62471598
复制相似问题