简体   繁体   English

已注册的 S3 方法被“GGally”覆盖:来自 +.gg 的方法 - RStudio 在不运行代码的情况下加载 package?

[英]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.

相关问题 R LANGUAGE:已注册的 S3 方法被“data.table”覆盖: - R LANGUAGE: Registered S3 method overwritten by 'data.table': 如何在不加载包的情况下从另一个包扩展 S3 方法 - How to extend S3 method from another package without loading the package library(pryr) 返回一条消息。 已注册的 S3 方法被 'pryr' 覆盖:来自 print.bytes Rcpp 的方法 - library(pryr) returns a message. Registered S3 method overwritten by 'pryr': method from print.bytes Rcpp 从另一个包导入S3方法 - Importing S3 method from another package 如何禁止将“S3 方法覆盖”消息打印到用户控制台 - how to suppress “S3 method overwritten” messages from being printed to user console 从未定义泛型函数的包导入S3方法 - Import an S3 method from a package that does not define the generic function 从卸载的R包中使用S3方法 - Using a S3 method from an unloaded R package S3通用方法没有出现在包装手册中 - S3 generic method not appearing in package manual 在不引入依赖关系的情况下,在 R package 中定义 S3 方法的首选方法是什么? - What's the preferred means for defining an S3 method in an R package without introducing a dependency? 如何在其命名空间中使用导出而不是S3method的其他包中的S3方法,而不使用Depends或library() - How to use S3 methods from another package which uses export rather than S3method in its namespace without using Depends or library()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM