rcorrelationr-corrplot

How can I highlight significant correlation in corrplot in R?


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


Solution

  • 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.