嗨,我正在尝试安装ggplot2软件包,但出现以下错误和警告。
install.packages("ggplot2")
also installing the dependency ‘rlang’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.2.0 0.3.0.1 TRUE
ggplot2 2.2.1 3.1.0 FALSE
Binaries will be installed
trying URL 'https://cran.cnr.berkeley.edu/bin/windows/contrib/3.3/rlang_0.2.0.zip'
Content type 'application/zip' length 754726 bytes (737 KB)
downloaded 737 KB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\abhijitk\AppData\Local\Temp\RtmpgtLRDo\downloaded_packages
installing the source package ‘ggplot2’
trying URL 'https://cran.cnr.berkeley.edu/src/contrib/ggplot2_3.1.0.tar.gz'
Content type 'application/x-gzip' length 2863109 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'rlang' 0.2.0 is being loaded, but >= 0.2.1 is required
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/abhijitk/Documents/R/R-3.3.0/library/ggplot2'
The downloaded source packages are in
‘C:\Users\abhijitk\AppData\Local\Temp\RtmpgtLRDo\downloaded_packages’
Warning messages:
1: running command '"C:/Users/abhijitk/Documents/R/R-3.3.0/bin/x64/R" CMD INSTALL -l "C:\Users\abhijitk\Documents\R\R-3.3.0\library" C:\Users\abhijitk\AppData\Local\Temp\RtmpgtLRDo/downloaded_packages/ggplot2_3.1.0.tar.gz' had status 1
2: In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status
答案 0 :(得分:0)
只需尝试安装https://cran.r-project.org/bin/windows/base/形式的“ R”当前版本,然后再次尝试install.packages(“ ggplot2”)。 90%的机会您将不再发现问题。