如何在R中生成我的data.frame的相关图? [英] How to generate correlation plot of my data.frame in R?

查看:129
本文介绍了如何在R中生成我的data.frame的相关图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个简单的问题。
我有一个df,我想为我在R中的数据生成一个相关图。

It might be a simple question. I have a df and I want to generate a correlation plot for my data in R.

head(df)

            x  y
1 -0.10967469  1
2  1.06814661 93
3  0.71805993 46
4  0.60566332 84
5  0.73714006 12
6 -0.06029712  5

我找到了一个名为 corPlot 的软件包,根据pearson& amp;产生了两个图Spearman方法。

I've found a package called corPlot and I've generated two plots based on pearson & spearman methods.

corPlot(df, method = 'pearson')
corPlot(df, method = 'spearman')

这是我的皮尔逊方法输出:

here is my output with pearson method:

我想知道是否还有另一个包可以生成我不知道的相同相关图?

I wondered if there is another package to generate the same correlation plots that I am not aware of?

预先感谢

推荐答案

还有另一个库corrplot

There is another library corrplot

library(corrplot)
cor.table = cor(df)
corrplot(cor.table)

这篇关于如何在R中生成我的data.frame的相关图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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