没有修改之前,默认顺序
library(MicrobiotaProcess)
phytax <- get_taxadf(qiimedata, taxlevel=2)
phybar <- ggbartax(obj=phytax,facetNames="group", count=FALSE) +
xlab(NULL) + ylab("Relative abundance (%)")+
theme(axis.text.x=element_text(face="plain",
color="black",hjust=0.8,vjust=0.6,
size=9, angle=90))+
theme(legend.position="right")
phybar
Fig01.png
但是,我想把组顺序修改为:CON,HFD,FA。
qiimedata@sam_data[["group"]]<-factor(qiimedata@sam_data[["group"]],levels = c("CON","HFD","FA"))
phytax <- get_taxadf(qiimedata, taxlevel=2)
phybar <- ggbartax(obj=phytax,facetNames="group", count=FALSE) +
xlab(NULL) + ylab("Relative abundance (%)")+
theme(axis.text.x=element_text(face="plain",
color="black",hjust=0.8,vjust=0.6,
size=9, angle=90))+
theme(legend.position="right")
phybar
Fig02.png
网友评论