参考
方法一
suppressMessages(library(PerformanceAnalytics))
chart.Correlation(rt,histogram = TRUE,pch=19,method="pearson")
方法二
suppressMessages(library(corrplot))
library(corrgram)
M <- round(cor(rt),4)
# 原生配色
col2 <- colorRampPalette(c("#67001F", "#B2182B", "#D6604D", "#F4A582",
"#FDDBC7", "#FFFFFF", "#D1E5F0", "#92C5DE",
"#4393C3", "#2166AC", "#053061"))
corrplot(M,
tl.col = 'black',
tl.pos = "ld",
tl.cex = 1.1,
cl.pos = "b",
method = "circle",
order = 'AOE',
col = rev(col2(200)),
mar = c(0,0,0,0),
type = "lower",
diag = FALSE,
addCoef.col = "grey20",
cl.cex=1,
p.mat = cor.mtest(t(M), conf.level = 0.95)$p
)
网友评论