I'm currently using corrplot()
from the corrplot
package in R and I've stumbled across two problems. For simplicity, I'll use the same notation as the help/introduction page for corrplot.
I'd like to inscribe either my p-value or how significant the test was (or both!) in all cells, not just the insignificant ones.
I'd like these inscriptions only in the upper triangular.
To address 2) first, I've been able to use this, but if feels kind of hacky:
corrplot(M, type="upper", p.mat = res1[[1]], insig="p-value", tl.pos="n")
corrplot(M, type="lower", add=T, tl.pos="d", cl.pos="n"))
However I haven't been able to figure out number 1. Any suggestions would be helpful!
The quick way is to add
sig.level=0
to the first plot, so all p-values are shown (actually, due to numerical precision some p-values will be exactly zero, so you may need to set it tosig.level=-0.1
, for example)This gives
However, if you want to add more detail to the p values it is probably easier to post-format the plot and add them using a
text
callTo give
Format function
My view (fwiw) is that this is adding too much info to the plot