I am trying to order the bars as "0", "5", "10", "20". The basic ggplot() keeps placing the bars out of order. Here is my code:
data <- data.frame(
Treatment=c("0","5", "10","20") ,
Salinity=c(21.8,22.5, 22.5, 23.5))
ggplot(data, aes(Treatment, Salinity, fill = x)) +
geom_bar(stat = "identity") +
ylim(0,25)+
ggtitle("Salicornia pacifica" )
And output Places the bars as "0", "10", "20", "5"
How do I set the order I want the bars, or rearrange the bars? enter image description here