0
這是我的代碼:秩序GGPLOT2分組條形圖
col1<-c(rep("first",2), rep("second",2), rep("third",2), rep("fourth",2), rep("fifth",2), rep("sixth",2), rep("seventh",2), rep("eighth",2))
col2<-gl(2,1,8, labels=c("one","two"))
col3<-Values
d1 <- data.frame(column1=col1, column2=col2, column3=col3)
ggplot(d, aes(x=column1, y=column3, fill=column2)) + geom_bar(position=position_dodge())
我的陰謀酒吧按字母順序排列,但我需要他們的順序爲COL1。我怎樣才能做到這一點?
查看此博客文章:http://trinkerrstuff.wordpress.com/2012/10/15/how-do-i-re-arrange-ordering-a-plot/ –