I create a correlation plot with this code:
require(ggpubr)
require(tidyverse)
require(Hmisc)
M = mydata % > %
select(var1, var2, var3, var4)
corrplot(cor(select_if(M, is.numeric)), method = "ellipse", type = "upper", col = c("black", "white"),
bg = "lightblue", tl.col = "black")
I would like to add a significance test as described on https://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html:
res1 < -cor.mtest(mydata, conf.level = .95)
M = mydata % > %
select(var1, var2, var3, var4)
corrplot(cor(select_if(M, is.numeric)), method = "ellipse", type = "upper", col = c("black", "white"),
bg = "lightblue", tl.col = "black", p.mat = res1$p, sig.level = .05)
But this doesn't work, I get this error message:
ERROR in ind[, 2] : incorrect number of dimensions
What's happening here?