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

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

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:

  1. > WARNING: Rtools is required to build R packages but is not currently
  2. > installed. Please download and install the appropriate version of
  3. > Rtools before proceeding:
  4. >
  5. > https://cran.rstudio.com/bin/windows/Rtools/ Installing package into
  6. > C:/Users/ErikNB/Documents/R/win-library/4.0 (as lib is
  7. > unspecified) also installing the dependencies cli’, lifecycle’,
  8. > rlang’, vctrs
  9. >
  10. >
  11. > There are binary versions available but the source versions are
  12. > later:
  13. > binary source needs_compilation
  14. >cli 3.2.0 3.6.1 TRUE
  15. >lifecycle 1.0.1 1.0.3 FALSE
  16. >rlang 1.0.2 1.1.1. TRUE
  17. >vctrs 0.4.1 0.6.3 TRUE
  18. >ggplot2 3.3.5 3.4.2. FALSE
  19. >
  20. > Binaries will be installed trying URL
  21. > 'https://cran.rstudio.com/bin/windows/contrib/4.0/cli_3.2.0.zip'
  22. > Content type 'application/zip' length 1255499 bytes (1.2 MB)
  23. > downloaded 1.2 MB
  24. >
  25. > trying URL
  26. > 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_1.0.2.zip'
  27. > Content type 'application/zip' length 1718546 bytes (1.6 MB)
  28. > downloaded 1.6 MB
  29. >
  30. > trying URL
  31. > 'https://cran.rstudio.com/bin/windows/contrib/4.0/vctrs_0.4.1.zip'
  32. > Content type 'application/zip' length 1569486 bytes (1.5 MB)
  33. > downloaded 1.5 MB
  34. >
  35. > package cli successfully unpacked and MD5 sums checked package
  36. > rlang successfully unpacked and MD5 sums checked package vctrs
  37. > successfully unpacked and MD5 sums checked
  38. >
  39. > The downloaded binary packages are in
  40. > C:\Users\ErikNB\AppData\Local\Temp\Rtmpuga9xh\downloaded_packages
  41. > installing the source packages lifecycle’, ggplot2
  42. >
  43. > trying URL
  44. > 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.3.tar.gz' Content
  45. > type 'application/x-gzip' length 106854 bytes (104 KB) downloaded 104
  46. > KB
  47. >
  48. > trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.4.2.tar.gz'
  49. > Content type 'application/x-gzip' length 3153811 bytes (3.0 MB)
  50. > downloaded 3.0 MB
  51. >
  52. > * installing *source* package 'lifecycle' ...
  53. > ** Paket 'lifecycle' erfolgreich entpackt und MD5 Summen überprüft
  54. > ** using staged installation
  55. > ** R
  56. > ** inst
  57. > ** byte-compile and prepare package for lazy loading Fehler in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  58. > namespace 'rlang' 1.0.2 is being loaded, but >= 1.0.6 is required Ruft
  59. > auf: <Anonymous> ... withCallingHandlers -> loadNamespace ->
  60. > namespaceImport -> loadNamespace Ausführung angehalten ERROR: lazy
  61. > loading failed for package 'lifecycle'
  62. > * removing 'C:/Users/ErikNB/Documents/R/win-library/4.0/lifecycle'
  63. > * restoring previous 'C:/Users/ErikNB/Documents/R/win-library/4.0/lifecycle' Warning in
  64. > install.packages : installation of package lifecycle had non-zero
  65. > exit status
  66. > * installing *source* package 'ggplot2' ...
  67. > ** Paket 'ggplot2' erfolgreich entpackt und MD5 Summen überprüft
  68. > ** using staged installation
  69. > ** R
  70. > ** data
  71. > *** moving datasets to lazyload DB
  72. > ** inst
  73. > ** byte-compile and prepare package for lazy loading Fehler in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  74. > namespace 'rlang' 1.0.2 is being loaded, but >= 1.1.0 is required Ruft
  75. > auf: <Anonymous> ... withCallingHandlers -> loadNamespace ->
  76. > namespaceImport -> loadNamespace Ausführung angehalten ERROR: lazy
  77. > loading failed for package 'ggplot2'
  78. > * removing 'C:/Users/ErikNB/Documents/R/win-library/4.0/ggplot2' Warning in install.packages : installation of package ggplot2 had
  79. > non-zero exit status

this is the output i get from sessionInfo()

  1. R version 4.0.5 (2021-03-31)
  2. Platform: x86_64-w64-mingw32/x64 (64-bit)
  3. Running under: Windows 10 x64 (build 19045)
  4. Matrix products: default
  5. locale:
  6. [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
  7. [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
  8. [5] LC_TIME=German_Germany.1252
  9. attached base packages:
  10. [1] stats graphics grDevices utils datasets methods
  11. [7] base
  12. loaded via a namespace (and not attached):
  13. [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:

确定