GGally 中的行为非常奇怪 -我在这里提出了一个问题。我想问你们的是,你们认为这是 RStudio 还是 GGally 中的错误吗?这是怎么发生的?
在一个全新的 R Studio 项目中,当打开包含一行具有 GGally 函数的代码的脚本时(在我的例子中,打开一个仅包含一行的脚本GGally::ggcorr(p),仅此而已),控制台中会弹出一条消息。
注册的 S3 方法被“GGally”覆盖:来自
+.gg ggplot2 的方法
甚至没有运行一行代码就会发生这种情况!
不知何故,GGally 似乎被加载到命名空间中,但仅在 RStudio 中,而不是在运行 reprex 时加载。此外 - 仅当我使用 调用函数时才会发生这种情况GGally::...,并且例如在以下情况下不会发生
library(GGally)
ggcorr(p)
Run Code Online (Sandbox Code Playgroud)
每当在 RStudio 中使用包含以下内容的已保存脚本重新启动 R 时,都会出现此消息GGally::...
SessionInfo(没有运行实际代码!)
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 GGally_2.1.1 magrittr_2.0.1 tidyselect_1.1.1
[5] munsell_0.5.0 colorspace_2.0-0 R6_2.5.0 rlang_0.4.11
[9] fansi_0.4.2 plyr_1.8.6 dplyr_1.0.5 tools_4.0.5
[13] grid_4.0.5 gtable_0.3.0 utf8_1.2.1 DBI_1.1.1
[17] ellipsis_0.3.2 yaml_2.2.1 assertthat_0.2.1 tibble_3.1.1
[21] lifecycle_1.0.0 crayon_1.4.1 purrr_0.3.4 RColorBrewer_1.1-2
[25] ggplot2_3.3.3 vctrs_0.3.8 glue_1.4.2 compiler_4.0.5
[29] pillar_1.6.0 generics_0.1.0 scales_1.1.1 reshape_0.8.8
[33] pkgconfig_2.0.3
Run Code Online (Sandbox Code Playgroud)
带有 reprex 包的 SessionInfo:
library(GGally)
ggcorr(p)
Run Code Online (Sandbox Code Playgroud)
由reprex 包于 2021 年 5 月 2 日创建(v2.0.0)