*disclaimer
602952
相関のグラフ
- サンプル dmu02shd
> head(dmu02shd) SL MHD MDD 1 5 1.500000 1.500000 2 4 1.000000 2.000000 5 7 2.000000 1.500000 6 5 1.250000 1.750000 7 4 1.333333 1.666667 8 4 1.333333 1.333333
plot() で散布図
- pairs() でも同じ
- オプション , panel = panel.smooth をつけると線を引いてくれる
> pairs(dmu02shd, panel = panel.smooth)
psychライブラリーを使う
library(psych) psych::pairs.panels(dmu02shd)
PerformanceAnalyticsを使う
library(PerformanceAnalytics) chart.Correlation(dmu02shd)
ggpairs()
install.packages("GGally", dependencies=T) library(ggplot2) library(GGally) ggpairs(dmu02shd)
https://sugiura-ken.org/wiki/