1. 首先我尝试在线安装ggplot2,结果如下:
utils:::menuInstallPkgs()
有二进制版本的,但源代码版本是后来的:
binary source needs_compilation
ggplot2 3.3.0 3.3.3 FALSE
安装源码包‘ggplot2’
试开URL’https://mirrors.bfsu.edu.cn/CRAN/src/contrib/ggplot2_3.3.3.tar.gz'
Content type 'application/octet-stream' length 3058840 bytes (2.9 MB)
downloaded 2.9 MB
* installing *source* package 'ggplot2' ...
** 成功将'ggplot2'程序包解包并MD5和检查
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'lifecycle' 0.1.0 is already loaded, but >= 0.2.0 is required
ERROR: lazy loading failed for package 'ggplot2'
* removing 'F:/R-3.5.2/library/ggplot2'
In R CMD INSTALL
下载的程序包在
‘C:\Users\Administrator\AppData\Local\Temp\RtmpqgCgQp\downloaded_packages’里
Warning message:
In install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) :
安装程序包‘ggplot2’时退出狀態的值不是0
2.我本地安装了lifecycle_0.2.0.tar.gz,结果如下:
utils:::menuInstallLocal()
* installing *source* package 'lifecycle' ...
** 成功将'lifecycle'程序包解包并MD5和检查
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'lifecycle'
finding HTML links ... 好了
badge html
deprecate_soft html
deprecated html
expect_deprecated html
Rd warning: C:/Users/Administrator/AppData/Local/Temp/RtmpWaByhf/R.INSTALL1a6c5a323918/lifecycle/man/expect_deprecated.Rd:17: file link 'expect_warning' in package 'testthat' does not exist and so has been treated as a topic
last_warnings html
lifecycle-package html
signal_experimental html
Rd warning: C:/Users/Administrator/AppData/Local/Temp/RtmpWaByhf/R.INSTALL1a6c5a323918/lifecycle/man/signal_experimental.Rd:28: file link 'signal' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Administrator/AppData/Local/Temp/RtmpWaByhf/R.INSTALL1a6c5a323918/lifecycle/man/signal_experimental.Rd:29: file link 'signalCondition' in package 'base' does not exist and so has been treated as a topic
verbosity html
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (lifecycle)
In R CMD INSTALL
3. 然后我觉得可能是R版本太旧了,所以装不上,试着本地安装了ggplot2_3.1.0.tar.gz,结果如下:
> utils:::menuInstallLocal()
ERROR: dependencies 'lazyeval', 'plyr', 'reshape2' are not available for package 'ggplot2'
* removing 'F:/R-3.5.2/library/ggplot2'
In R CMD INSTALL
Warning message:
In install.packages(files[tarballs], .libPaths()[1L], repos = NULL, :
安装程序包‘F:/R-3.5.2/library/ggplot2_3.1.0.tar.gz’时退出狀態的值不是0
4. 我又本地安装了plyr_1.8.5.tar.gz,结果如下:
> utils:::menuInstallLocal()
* installing *source* package 'plyr' ...
** 成功将'plyr'程序包解包并MD5和检查
** libs
*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'plyr'
* removing 'F:/R-3.5.2/library/plyr'
In R CMD INSTALL
Warning message:
In install.packages(files[tarballs], .libPaths()[1L], repos = NULL, :
安装程序包‘F:/R-3.5.2/library/plyr_1.8.5.tar.gz’时退出狀態的值不是0
>
因为我的rstudio 装了1.1.462exe,适配的R版本就用了R 3.5.2
求助:该怎样操作才能安装上合适的ggplot2?