r - How can I change the order of the discrete x-axis for a beeswarm plot? -
this question has answer here:
- r - ordering in boxplot 2 answers
i'm using beeswarm
plot data.
d<-data.frame(cond=c(wt,wt,ko,ko),count=c(1,2,3,4)) beeswarm(count ~ cond, data = d)
this produces following image.
how can manually specify x-axis, wt comes before ko?
d<-data.frame(cond=c("wt","wt","ko","ko"),count=c(1,2,3,4)) #turn factor manual specification of levels d$cond <- factor(d$cond,levels=c("wt","ko")) #plot beeswarm(count ~ cond, data = d)
Comments
Post a Comment