ggcorrplot icon indicating copy to clipboard operation
ggcorrplot copied to clipboard

support for non-square correlation matrix

Open mt1022 opened this issue 7 years ago • 4 comments

Is it possible for ggcorrplot to support non-square correlation matrix? Such case is frequently in data analysis, for example when we only want to visualize correlation of a group of columns with another group of columns:

data(mtcars)

df1 <- mtcars[1:3]
df2 <- mtcars[4:7]

corr <- cor(df1, df2)
#              hp       drat         wt       qsec
# mpg  -0.7761684  0.6811719 -0.8676594  0.4186840
# cyl   0.8324475 -0.6999381  0.7824958 -0.5912421
# disp  0.7909486 -0.7102139  0.8879799 -0.4336979

ggcorrplot currently can not draw non-square correlation matrix. Also cor_pmat only takes single argument and cannot get p.values for correlation between two data.frame s.

mt1022 avatar May 02 '17 13:05 mt1022

Thank you for this suggestion. I'll update the package so that it can handle such cases.

kassambara avatar May 02 '17 13:05 kassambara

Were there any advances on non-square matrix support? Did the ggcorrplot maintainers agree to work on this request?

ferreirafm avatar Oct 31 '19 20:10 ferreirafm

How's it coming folx?

scbrinkley avatar Nov 04 '21 02:11 scbrinkley

I still can't plot a non-square correlation matrix with ggcorrplot. Any workaround?

lysendee avatar Feb 14 '23 13:02 lysendee