My current data looks something like this df:
Year Labels Cost Order
2006 A 1000 1
2007 B 2000 2
2008 B 2000 2
2009 C 3000 4
2010 NA 0 NA
etc.
As of now, my stacked chart is in the form of 1,2,4,NA I want to create a stacked chart of bar chart such that the bars are arranged in the following order (4,2,1,NA).
Ive tried:
ggplot(df[order(df$order,decreasing=T),],
aes(x=x,y=y,fill=labels))+
geom_bar(stat="identity")
But my order is the same. Anyone have any advice using dplyr?