微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

GGally 中的 ggscatmat 绘图无法使用增加的列数

如何解决GGally 中的 ggscatmat 绘图无法使用增加的列数

我一直在使用 GGplot 库中的 ggscatmat生成相关矩阵图。我遇到了两个问题/问题:

  1. 当我将图中的列数增加到超过 9 时,图的格式会变得混乱。我可以比较的列对是否有硬性限制?

  2. 我收到一条警告,提示 Factor variables are omitted in plot。然而,数据集中的所有列都是数字(见帖子末尾的截图),所以我很困惑为什么会出现这个警告。

有什么想法吗?

#// load Ggally library
library(Ggally)
#> Loading required package: ggplot2
#> Registered S3 method overwritten by 'Ggally':
#>   method from   
#>   +.gg   ggplot2

#// generate datafram
data <- data.frame(rep(mtcars[1:5],3))

#// ggscatmat with increasing column numbers
ggscatmat(data[1:5],columns = 1:5,color = "cyl",alpha  = 0.8)

#> Warning in ggscatmat(data[1:5],alpha = 0.8):
#> Factor variables are omitted in plot

ggscatmat(data[1:10],columns = 1:10,alpha  = 0.8)

#> Warning in cor(xvalue,yvalue,use = "pairwise.complete.obs",method =
#> corMethod): the standard deviation is zero

[...]

#> Warning in ggscatmat(data[1:10],alpha = 0.8):
#> Factor variables are omitted in plot

ggscatmat(data[1:15],columns = 1:15,method =
#> corMethod): the standard deviation is zero

[...]

#> Warning in ggscatmat(data[1:15],alpha = 0.8):
#> Factor variables are omitted in plot

data 的屏幕截图,显示所有列都是数字。

enter image description here

reprex package (v0.3.0) 于 2021 年 1 月 29 日创建

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。