I'm using beeswarm
to plot my data.
d<-data.frame(Cond=c(WT,WT,KO,KO),Count=c(1,2,3,4))
beeswarm(Count ~ Cond, data = d)
This produces the following image.
How can I manually specify the x-axis, so that WT comes before KO?
I'm using beeswarm
to plot my data.
d<-data.frame(Cond=c(WT,WT,KO,KO),Count=c(1,2,3,4))
beeswarm(Count ~ Cond, data = d)
This produces the following image.
How can I manually specify the x-axis, so that WT comes before KO?
d<-data.frame(Cond=c("WT","WT","KO","KO"),Count=c(1,2,3,4))
#turn into a factor with manual specification of levels
d$Cond <- factor(d$Cond,levels=c("WT","KO"))
#plot
beeswarm(Count ~ Cond, data = d)
It was a lot about that here
d<-data.frame(Cond=c('WT', 'WT', 'KO', 'KO'),Count=c(1,2,3,4))
library(beeswarm)
beeswarm(Count ~ Cond, data = d)
f <- ordered(d$Cond, levels = c("WT", "KO"))
beeswarm(Count ~ f, data = d)