r - How can I change the order of the discrete x-axis for a beeswarm plot? -


this question has answer here:

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.

enter image description here

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) 

enter image description here


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -