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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -