R语言数据分析之二-《R语言判断相关性-excel文件xlsx文件》
一、处理excel复制数据,如上图所示粘贴文件另存为txt二、R语言读入install.packages("corrplot")library("corrplot")result=cor(read.table(file='C:/Users/wenxiaoyu_intern/Desktop/销量.txt',row.names=1,header=T,sep="\t"))上面XXX改成自己的路径圆形显示
·
一、处理excel

复制数据,如上图所示粘贴

文件另存为txt
二、R语言读入
install.packages("corrplot")
library("corrplot")
result=cor(read.table(file='C:/Users/wenxiaoyu_intern/Desktop/销量.txt',row.names=1,header=T,sep="\t"))
上面XXX改成自己的路径
圆形显示,饼图显示
corrplot(result)
corrplot(result,method="pie")
corrplot(result,method='pie',type="upper",col=col(10),tl.pos="d")
R语言下载与excel读入见
R语言数据分析之一—《R语言下载与读取excel导入excel》
更多推荐



所有评论(0)