# 加载 readxl 包
library(readxl)
# 读取 xlsx 文件
df<-read.csv("Seed_Data.csv")
df <- read_excel("XG.xlsx")
df <- read_excel("random_forest.xlsx",sheet = 'line_XG2')
#(更正一下,先加载包再读入表格数据,其中read后面是下划线,不是点点)
head(df)
#install.packages("GGally")
library("GGally")
#ggpairs(df,columns = 1:21)
#ggpairs(df,columns = 1:7)
ggpairs(df,columns = 1:8)
df$target<-factor(df$target)
cols<-c("steelblue","yellowgreen","violetred1")
p<-ggpairs(df,
columns = 1:8,
aes(color=target))+
scale_color_manual(values = cols)+
scale_fill_manual(values = cols)+
theme_bw()+
theme(axis.text = element_text(colour = "black",
size = 11),
strip.background = element_rect(colour = "white",
size=12),
strip.text = element_text(face="bold"))
print(p)http://127.0.0.1:12819/graphics/plot_zoom_png?width=1463&height=844
#........................相关性分析..........
# 加载 r
相关性曲线图及相关性热图
最新推荐文章于 2024-04-28 10:11:31 发布