GGpairs,相关值不对齐 [英] GGpairs, correlation values are not aligned

查看:138
本文介绍了GGpairs,相关值不对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用GGpairs创建一个相关矩阵,散点图由组(reg或irreg)着色。在上角绘制的相关值未对齐,如您在图像中看到的,Cor,reg和irreg值未对齐。



我使用的代码是这样的:

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

数据在这里:


I am trying to create a correlation matrix using GGpairs, the scatterplots are coloured by group (reg or irreg). The correlation values plotted on the upper corner are not aligned, as you see in the image here the Cor, reg and irreg values are not aligned.

The code I use is this:

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

The data is here: replicatable data

Any suggestion? Thank you thank you!

Chuck

解决方案

This seems to work:

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)))

这篇关于GGpairs,相关值不对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆