首页 文章

相关图(corrplot)压缩相关值

提问于
浏览
1

我正在尝试绘制一个日内相关矩阵,但是当我使用 corrplot 时,我的相关值被压扁并且没有明显的资格 .

我试过弄乱外边距和内边距,但这也不起作用 . 任何人都可以提出如何解决这个问题的建议吗?

corrplot(DO0182U09A3_24hrCor, 
         method = "number", 
         type = "lower",
         mfrow=c(1,1),
         oma=c(0.1,0.1,0.1,0.1),
         mar=c(0,0,1,0),
         title = "Correlation plot between days for DO0192U09A3")

enter image description here

1 回答

  • 2

    您可以尝试@drsimonj包 corrr ,它具有良好的打印功能:

    > mtcars %>% correlate() %>% fashion()
       rowname  mpg  cyl disp   hp drat   wt qsec   vs   am gear carb
    1      mpg      -.85 -.85 -.78  .68 -.87  .42  .66  .60  .48 -.55
    2      cyl -.85       .90  .83 -.70  .78 -.59 -.81 -.52 -.49  .53
    3     disp -.85  .90       .79 -.71  .89 -.43 -.71 -.59 -.56  .39
    4       hp -.78  .83  .79      -.45  .66 -.71 -.72 -.24 -.13  .75
    5     drat  .68 -.70 -.71 -.45      -.71  .09  .44  .71  .70 -.09
    6       wt -.87  .78  .89  .66 -.71      -.17 -.55 -.69 -.58  .43
    7     qsec  .42 -.59 -.43 -.71  .09 -.17       .74 -.23 -.21 -.66
    8       vs  .66 -.81 -.71 -.72  .44 -.55  .74       .17  .21 -.57
    9       am  .60 -.52 -.59 -.24  .71 -.69 -.23  .17       .79  .06
    10    gear  .48 -.49 -.56 -.13  .70 -.58 -.21  .21  .79       .27
    11    carb -.55  .53  .39  .75 -.09  .43 -.66 -.57  .06  .27
    

    以及 ggplot2 打印功能"correlation data frames":

    mtcars %>% correlate() %>% shave() %>% rplot(print_cor=TRUE)
    

    cordf plot

    或者,您可以打印相关图:

    mtcars %>% correlate() %>% network_plot()
    

    network plot

相关问题