I am trying to specify the order of columns in a ggplot2
bar plot where 'dodge' has been applied. The required order of cases is CC (for control) C2, C3 and C4. However, when plotted, these come out as C2, C3, C4, CC (no surprise since 'C' has a higher ASCII value than 4, I suppose).
Is there a way to specify the order of columns when 'dodge' has been applied? I have seen explanations where the order is reversed, but I simply want to specify the order.
The code (so far) is:
GeneExp <- ggplot(genePlot, aes(x=Gene, y=Value, fill=Case) ) +
geom_bar(stat="identity", position="dodge")