[英]Registered S3 method overwritten by 'GGally': method from +.gg - RStudio loading package without running code?
Very peculiar behaviour in GGally - I filed an issue here . GGally 中非常奇怪的行为 -我在这里提交了一个问题。 My question to you folks is, do you think that is a bug in RStudio or in GGally.
我的问题是,你们认为这是 RStudio 或 GGally 中的错误吗? How does this even happen?
这怎么会发生?
In a completely new R Studio project, when opening a script that contains a line of code with a GGally function (In my case, opening a script just containing a line GGally::ggcorr(p)
, nothing more), there will pop a message into the console.在一个全新的 R Studio 项目中,当打开一个包含带有 GGally function 代码行的脚本时(在我的例子中,打开一个只包含一行
GGally::ggcorr(p)
的脚本,仅此而已),会弹出一个消息到控制台。
Registered S3 method overwritten by 'GGally': method from
已注册的 S3 方法被“GGally”覆盖:方法来自
+.gg ggplot2+.gg ggplot2
This happens without even running a line of code!!这甚至没有运行一行代码就发生了!!
Somehow, GGally seems to be loaded into the namespace, but only in RStudio, not when running a reprex.不知何故,GGally 似乎被加载到命名空间中,但仅在 RStudio 中,而不是在运行 reprex 时。 Further - this only happens when I am calling a function with
GGally::...
, and does not happen when for example此外 - 这仅在我使用
GGally::...
调用 function 时发生,并且不会发生,例如
library(GGally)
ggcorr(p)
And this message comes whenever restarting R within RStudio with a saved script containing GGally::...
每当在 RStudio 中使用包含
GGally::...
SessionInfo (without having run actual code!) 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
SessionInfo with reprex package:带有 reprex package 的 SessionInfo:
sessionInfo()
#> R version 4.0.5 (2021-03-31)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur 10.16
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] knitr_1.33 magrittr_2.0.1 rlang_0.4.11 fansi_0.4.2
#> [5] stringr_1.4.0 styler_1.4.1 highr_0.9 tools_4.0.5
#> [9] xfun_0.22 utf8_1.2.1 withr_2.4.2 htmltools_0.5.1.1
#> [13] ellipsis_0.3.2 yaml_2.2.1 digest_0.6.27 tibble_3.1.1
#> [17] lifecycle_1.0.0 crayon_1.4.1 purrr_0.3.4 vctrs_0.3.8
#> [21] fs_1.5.0 glue_1.4.2 evaluate_0.14 rmarkdown_2.7
#> [25] reprex_2.0.0 stringi_1.5.3 compiler_4.0.5 pillar_1.6.0
#> [29] backports_1.2.1 pkgconfig_2.0.3
Created on 2021-05-02 by the reprex package (v2.0.0)由reprex package (v2.0.0) 创建于 2021-05-02
This is caused by RStudio code diagnostics - they can be modified / turned on/off under这是由 RStudio 代码诊断引起的 - 它们可以在下面修改/打开/关闭
Tools > Global options > Code > Diagnostics
工具 > 全局选项 > 代码 > 诊断
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.