如何突出显示R中corrplot中的显着相关性? [英] How can I highlight significant correlation in corrplot in R?
问题描述
在R的Corrplot中,我们可以通过提供p值矩阵并使用函数"insig"和"pch"来突出显示无关紧要的(<0.05).
In corrplot in R, we can highlight insignificant correlation (<0.05) by supplying p-value matrix and using function "insig" and "pch".
但是我只想突出显示p值小于0.05的显着相关.
But I want highlight only Significant correlation having p-value less than 0.05.
有什么办法可以做相反的事情吗?
Is there any way to do the opposite?
最诚挚的问候
Shriram
推荐答案
我查看了corrplot
的源代码.据我了解的代码,不可能做到与有效值完全相反.真正接近您想要的唯一选择是定义insig = "blank"
.这将导致不重要的相关性简单地消失.
I looked into the source code of corrplot
. As far as I understand the code, it is not possible to do the exact opposite to the significant values. The only option that comes really close to what you want is defining insig = "blank"
. This will cause the non-significant correlations to simply disappear.
我能想到的最好的解决方案是联系软件包的作者,并询问是否可以实施:
The best solution I can think of is to contact the author of the package and ask if this can be implemented: https://cran.r-project.org/web/packages/corrplot/index.html
另一种选择是自己调整corrplot
的源代码,以根据需要进行调整.
An other option is to tweak the source code of corrplot
yourself, to adjust it to your needs.
Also, if you haven't yet, check out the vignettes for corrplot
: https://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html
或者,指定insig = blank
,我认为它与您想要的非常接近..不确定.
Or, specify insig = blank
, which I think comes pretty close to what you want.. not sure.
这篇关于如何突出显示R中corrplot中的显着相关性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!