How can I highlight significant correlation in corrplot in R?

落花浮王杯 提交于 2019-12-04 06:44:20

问题


In corrplot in R, we can highlight insignificant correlation (<0.05) by supplying p-value matrix and using function "insig" and "pch".

But I want highlight only Significant correlation having p-value less than 0.05.

Is there any way to do the opposite?

Best regards

Shriram


回答1:


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

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

Edit: Or, specify insig = blank, which I think comes pretty close to what you want.. not sure.



来源:https://stackoverflow.com/questions/36401843/how-can-i-highlight-significant-correlation-in-corrplot-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!