2016-11-11 100 views
1

我正在嘗試使用GGpairs創建相關矩陣,散點圖由組(reg或irreg)着色。在上角繪製的相關值未對齊,如您在圖像中看到的,Cor,reg和irreg值未對齊。 enter image description hereGGpairs,相關值不對齊

我使用的代碼是這樣的:

ggpairs(data=dat4, 
    columns=1:5, 
    title="correlation matrix",    
    mapping= aes(colour = irregular), 
    lower = list(
    continuous = "smooth", 
    combo = "facetdensity", 
    mapping = aes(color = irregular))) 

的數據是在這裏:replicatable data

什麼建議嗎?謝謝謝謝!

回答

2

這似乎工作:

ggpairs(data=dat4, 
     columns=1:5, 
     title="correlation matrix",    
     mapping= aes(colour = irregular), 
     lower = list(
      continuous = "smooth", 
      combo = "facetdensity", 
      mapping = aes(color = irregular)), 
     upper = list(continuous = wrap("cor", size = 3, hjust=0.8))) 

enter image description here

+1

太好了,謝謝Sandipan! –