corrplot导致奇怪的错误

时间:2015-02-17 00:11:40

标签: r r-corrplot

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

它们包含来自两个变量之间的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))

奇怪的一个 The weird result

正常的 The normal result

1 个答案:

答案 0 :(得分:1)

好的,我已经解决了。

没有任何p值大于sig.level所需的p值,它们都小于0.05。一旦我编辑了一个大于0.05的值,它就会起作用

例如

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

作品