R languge correlation plot

2021-01-13  本文已影响0人  ab02f58fd803

R语言关于相关性的热度图绘制

# reference:https://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html
# https://github.com/taiyun/corrplot
# install in R: install.packages("corrplot")
library(corrplot)

#corrplot 0.84 loaded
# 载入原始文件
M <- cor(mtcars)

# 保存文件pdf
pdf(file = "yourfilename.pdf")
# 绘制图 number.cex 改数字字体大小
corrplot(M, method = "circle",  type = "upper" ,title = "correlation",
mar = c(0,0,1,0), number.cex = 0.5, number.digits = 2)
dev.off()
image.png
上一篇下一篇

猜你喜欢

热点阅读