R语言简单绘制小提琴图
原始数据:
R语言脚本:
install.packages("vioplot")#安装vioplot包
library("vioplot") #安装和载入vioplot包
data<-read.csv("fb盒形图.csv")
x1<-data$H0
x2<-data$H1
x3<-data$M0
x4<-data$M1
vioplot(x1,x2,x3,x4,names=c("non-HDM","DM","non-MDM","MDM"),col=c("skyblue","orange","royalblue", "red"),ylim =c(0,28))
title(xlab = "",ylab="F:B")#绘制小提琴图
wilcox.test(x1,x2)#数据不符合正态分布时作非参检验
wilcox.test(x3,x4)
END
赞 (0)