corrplot with p-values and r-values


Recently, I was looking over the examples of corrplot and corrplot.mixed and can't find an answer to this question.

  • How to make a plot of correlations that show both
    -- p-values in the upper
    -- r-values in the lower

These get so frustratingly close to what I want, just in the reverse.
My goal is to blank out the insignificant ones and show the p-values in the upper and then show the corresponding r-values in the lower.

M <- cor(mtcars)
res1 <- cor.mtest(mtcars, conf.level = 0.95)
ord <- corrMatOrder(M, order = "AOE")
M2 <- M[ord,ord]

corrplot(M, p.mat = res1$p, insig = "blank")
corrplot(M, p.mat = res1$p, insig = "p-value")
corrplot(M, p.mat = res1$p, insig = "p-value", sig.level = -1) ## add all p-values


I realize that this is similar to p- and r-values in the same graph, but these seem simpler for what I'm trying to accomplish.

Any help or suggestions are greatly appreciated.

Jason the #rstatsnewbie

After quite a bit of trial and error, I managed to get the solution from the linked post to work. Work is still needed to tweak the aesthetics, but it meets the basic need for now.

Jason the #rstatsnewbie

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.