Does anyone have any idea how to order the factors in just 1 bar in ggplot2? Reorder data no longer works: (
In case I would like to invert the first bar, so that the green one stays up and the red one down.
library(ggplot2)
dados <- expand.grid(a = letters[1:5], b = letters[1:2])
dados$a <- paste(dados$a)
dados$b <- paste(dados$b)
dados$val <- rnorm(10, 5, 1)
ggplot(aes(x = a, y = val, fill = b), data = dados) + geom_bar(stat = 'identity')
dados2 <- rbind(tail(dados, -1), head(dados, 1))
ggplot(aes(x = a, y = val, fill = b), data = dados2) + geom_bar(stat = 'identity') # Funcionava nas versões anteriores :\