【R语言小知识】相关性热图的制作
library(corrplot)
x1<- c(3.2,2.5,2.9,1.4)
x2<- c(9.8,8.5,7.4,2.6)
x3<- c(7.3,6.5,8.1,3.5)
x4<- c(9.5,52,8.5,81)
dt <- as.data.frame(cbind(x1,x2,x3,x4))
cor_result_trait <- sapply(dt,cor,dt)
rownames(cor_result_trait)<-colnames(dt)
corrplot(cor_result_trait,method = "circle",addCoef.col = "green")