df.m <- transform(df.m, Period = reorder(Period, -1*value))
ggplot(df.m, aes(x = Period, y = value/1e+06, fill = Region)) +
geom_bar(stat = "identity", position = "stack")
=====================================================
levels(df.m$Period)
[1] "1820-30" "1831-40" "1841-50" "1851-60" "1861-70" "1871-80" "1881-90"
[8] "1891-00" "1901-10" "1911-20" "1921-30" "1931-40" "1941-50" "1951-60"
[15] "1961-70" "1971-80" "1981-90" "1991-00" "2001-06"
=====================================================
I think after reordering, the levels changed, but the fact was nothing has
got change >_<!!!
I found I have many commands happen like this. especially drawing
graph...ordering doesn't work...
[[elided Yahoo spam]]
it is crazy, "R" teases me.
--
View this message in context: http://r.789695.n4.nabble.com/ggplot-rank-stack-bar-automatically-tp4391042p4403442.html
Sent from the R help mailing list archive at Nabble.com.