在R中安装ggplot2和处理交互的问题。

huangapple go评论84阅读模式
英文:

Problems with installing ggplot2 and interactions in R

问题

I installed rtools. However the error saying that rtools is needed didn't disappear.
我安装了rtools。然而,显示需要rtools的错误仍然没有消失。

I tried updating rslang. however every time I tried to update it, it just shows the old version afterwards. I'm too scared to uninstall it, because of what happened with ggplot2.
我尝试更新rslang。但是每次我尝试更新它,之后它仍然显示旧版本。我因为ggplot2的问题而害怕卸载它。

英文:

I wanted to use the packages ggplot2 and interactions. I first installed interactions and then ggplot2. However I got error messages because I did not have the newest version of ggplot2.
I tried updating ggplot2, which repeatedly did not work. So I deinstalled it and tried reinstalling it. Now I can't even install it again and "interactions" doesn't work either.
I don't understand what I did wrong, because I could install it the first time.

Ihis is the error message I get, when trying to install ggplot now:

> WARNING: Rtools is required to build R packages but is not currently
> installed. Please download and install the appropriate version of
> Rtools before proceeding:
> 
> https://cran.rstudio.com/bin/windows/Rtools/ Installing package into
> ‘C:/Users/ErikNB/Documents/R/win-library/4.0’ (as ‘lib’ is
> unspecified) also installing the dependencies ‘cli’, ‘lifecycle’,
> ‘rlang’, ‘vctrs’
> 
> 
>   There are binary versions available but the source versions   are
> later:
>           binary source needs_compilation   
>cli        3.2.0  3.6.1              TRUE   
>lifecycle  1.0.1  1.0.3             FALSE   
>rlang      1.0.2  1.1.1.            TRUE   
>vctrs      0.4.1  0.6.3              TRUE   
>ggplot2    3.3.5  3.4.2.            FALSE 
> 
>   Binaries will be installed trying URL
> 'https://cran.rstudio.com/bin/windows/contrib/4.0/cli_3.2.0.zip'
> Content type 'application/zip' length 1255499 bytes (1.2 MB)
> downloaded 1.2 MB
> 
> trying URL
> 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_1.0.2.zip'
> Content type 'application/zip' length 1718546 bytes (1.6 MB)
> downloaded 1.6 MB
> 
> trying URL
> 'https://cran.rstudio.com/bin/windows/contrib/4.0/vctrs_0.4.1.zip'
> Content type 'application/zip' length 1569486 bytes (1.5 MB)
> downloaded 1.5 MB
> 
> package ‘cli’ successfully unpacked and MD5 sums checked package
> ‘rlang’ successfully unpacked and MD5 sums checked package ‘vctrs’
> successfully unpacked and MD5 sums checked
> 
> The downloaded binary packages are in
> 	C:\Users\ErikNB\AppData\Local\Temp\Rtmpuga9xh\downloaded_packages
> installing the source packages ‘lifecycle’, ‘ggplot2’
> 
> trying URL
> 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.3.tar.gz' Content
> type 'application/x-gzip' length 106854 bytes (104 KB) downloaded 104
> KB
> 
> trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.4.2.tar.gz'
> Content type 'application/x-gzip' length 3153811 bytes (3.0 MB)
> downloaded 3.0 MB
> 
> * installing *source* package 'lifecycle' ...
> ** Paket 'lifecycle' erfolgreich entpackt und MD5 Summen überprüft
> ** using staged installation
> ** R
> ** inst
> ** byte-compile and prepare package for lazy loading Fehler in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :   
> namespace 'rlang' 1.0.2 is being loaded, but >= 1.0.6 is required Ruft
> auf: <Anonymous> ... withCallingHandlers -> loadNamespace ->
> namespaceImport -> loadNamespace Ausführung angehalten ERROR: lazy
> loading failed for package 'lifecycle'
> * removing 'C:/Users/ErikNB/Documents/R/win-library/4.0/lifecycle'
> * restoring previous 'C:/Users/ErikNB/Documents/R/win-library/4.0/lifecycle' Warning in
> install.packages :   installation of package ‘lifecycle’ had non-zero
> exit status
> * installing *source* package 'ggplot2' ...
> ** Paket 'ggplot2' erfolgreich entpackt und MD5 Summen überprüft
> ** using staged installation
> ** R
> ** data
> *** moving datasets to lazyload DB
> ** inst
> ** byte-compile and prepare package for lazy loading Fehler in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :   
> namespace 'rlang' 1.0.2 is being loaded, but >= 1.1.0 is required Ruft
> auf: <Anonymous> ... withCallingHandlers -> loadNamespace ->
> namespaceImport -> loadNamespace Ausführung angehalten ERROR: lazy
> loading failed for package 'ggplot2'
> * removing 'C:/Users/ErikNB/Documents/R/win-library/4.0/ggplot2' Warning in install.packages :   installation of package ‘ggplot2’ had
> non-zero exit status

this is the output i get from sessionInfo()

R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

loaded via a namespace (and not attached):
[1] compiler_4.0.5 tools_4.0.5   
  1. I installed rtools. However the error saying that rtools is needed didn't disappear.
  2. I tried updating rslang. however every time I tried to update it, it just shows the old version afterwards. I'm too scared to uninstall it, because of what happened with ggplot2.

答案1

得分: 0

LEK,从这里看来:

移除 'C:/Users/ErikNB/Documents/R/win-library/4.0/ggplot2'

看起来你并没有使用最新版本的 R,实际上最新版本是 4.3.1 ---》 https://www.r-project.org/

如果 4.0 不是必需的话,我建议你从头开始安装最新版本的 R,然后再尝试安装 interactionsggplot2 包。

英文:

LEK, it seems from here:

> removing 'C:/Users/ErikNB/Documents/R/win-library/4.0/ggplot2'

that you are not using the latest version of R itself, which is actually 4.3.1 ---> https://www.r-project.org/

I would start from scratch by installing the latest version of R, if 4.0 is not a must, and then trying again to install interactions and ggplot2 packages.

答案2

得分: 0

"Like Fede B said: I needed the newest version of R. Just installing it from Rstudio did not work, i had to deinstall all older versions of r before i could use the new one. I had to reinstall almost all of my packages, but i had no problem with "ggplot2" and "interactions" anymore! Thank you."

"像Fede B所说:我需要最新版本的R。仅从Rstudio安装它并不起作用,我必须卸载所有旧版本的R,然后才能使用新版本。我不得不重新安装几乎所有的包,但是不再出现对“ggplot2”和“interactions”的问题了!谢谢。"

英文:

Like Fede B said: I needed the newest version of R. Just installing it from Rstudio did not work, i had to deinstall all older versions of r before i could use the new one. I had to reinstall almost all of my packages, but i had no problem with "ggplot2" and "interactions" anymore! Thank you.

huangapple
  • 本文由 发表于 2023年7月5日 01:17:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76614736.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定