library(ggplot2)#加載ggplot2包
library(ggsignif)#加載顯著性包
setwd('d:')#設置工作路徑
read.table('ahga.txt',header = TRUE,sep = '\t',stringsAsFactors = T)#讀取文件,保持標題,保持因素型變量
head(da)#展示前幾行數據
compire<-list(c('A','B'),c('A','C'),c('B','C'))#添加要進行多重比較的數據列
ggplot(da,aes(x=Genotype,y=VLCFA,fill=Genotype))+geom_boxplot()+geom_signif(comparisons = compire,step_increase=0.5,map_signif_level = T,test = wilcox.test)#畫箱圖,並根據t檢驗結果,添加顯著性