corrplot 导致奇怪的错误

corrplot causing weird error

我在下面定义了两个集合矩阵:

它们包含来自两个变量之间的 t 检验的 p 值(我知道这是糟糕的统计实践)

我正在尝试使用 corrplot 包中的相关图来绘制它们

但是,当我使用以下行时:

corrplot(weird, insig = "p-value", p.mat = weird, type = "lower", sig.level = 1-0.95, method = "circle", is.corr = FALSE,  cl.lim=c(0,1), tl.offset=0.4)

正常矩阵显示正确,但奇怪的矩阵显示不正确。 这让我很沮丧,我已经将问题缩小到 insig="p-value" 参数,因为 corrplot 函数在没有它的情况下仍能正常工作。

weird<-structure(c(2.22044604925031e-16, 0.018443376602325, 2.12390642555483e-12, 
2.22044604925031e-16, 0.018443376602325, 2.22044604925031e-16, 
2.22044604925031e-16, 2.22044604925031e-16, 2.12390642555483e-12, 
2.22044604925031e-16, 3.00501193636783e-06, 2.5333487645982e-12, 
2.22044604925031e-16, 2.22044604925031e-16, 2.5333487645982e-12, 
0.0197044105270931), .Dim = c(4L, 4L), .Dimnames = list(NULL, 
    NULL))

normal<-structure(c(0.34190041513821, 0.957047560166067, 0.680056137259229, 
0.00101879090792332, 1.2138613135621e-09, 0.406147270030259, 
0.957047560166067, 0.343145355714736, 0.157301364839312, 0.0223978064844035, 
2.92279774741867e-07, 0.904700589348579, 0.680056137259229, 0.157301364839312, 
0.620933486276745, 0.000609313754058382, 2.10803751235147e-10, 
0.411208816692722, 0.00101879090792332, 0.0223978064844035, 0.000609313754058382, 
8.78613655419196e-05, 9.15187128142626e-12, 0.197743409064612, 
1.2138613135621e-09, 2.92279774741867e-07, 2.10803751235147e-10, 
9.15187128142626e-12, 0.00179242617730144, 0.0159636230788393, 
0.406147270030259, 0.904700589348579, 0.411208816692722, 0.197743409064612, 
0.0159636230788393, 1.5372324857583e-07), .Dim = c(6L, 6L), .Dimnames = list(
    NULL, NULL))

奇怪的

正常的

好的,我已经解决了。

没有任何 p 值大于 sig.level 要求的值,所有 p 值均小于 0.05。一旦我将一个值编辑为大于 0.05,它就会起作用

例如

weird[1,1] <- 0.1
corrplot(weird)

有效