TheGoat
TheGoat

Reputation: 2877

Correlation plot (corrplot) squashed correlation values

I am trying to plot an intraday correlation matrix but when I use corrplot my correlation values are squashed and not clearly eligible.

I have tried messing with the outer and inner margins but this is not working either. Can anyone make a suggestion as to how I can solve this problem?

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

Upvotes: 1

Views: 823

Answers (1)

dmi3kno
dmi3kno

Reputation: 3055

You could try @drsimonj package corrr which has functions for nice printing:

> 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     

As well as ggplot2 capabilities for printing "correlation data frames":

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

cordf plot

Alternatively you can print correlation graph:

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

network plot

Upvotes: 2

Related Questions