ggplot(data,aes(x=ab,y=Freq/total,fill=Result))+
geom_bar(stat=\"identity\")+
theme(strip.text.x = element_text(size=8, angle=0),
strip.background =
It's a bit of a hacked fix but it works. ggplot will plot the stacked bars in the order it encounters them when using stat = "identity". To get the stack in the order D,B,C,A reorder your data.frame like this:
data <- data[c(data$Result == "D",
data$Result == "B",
data$Result == "C",
data$Result == "A"),]
the entry in the ggplot2 help files could be better in this respect.