how to order bars according to the sales within each category require(ggplot2) require(dplyr)
df <- data.frame (Origin = c("Canada", "Canada","USA","USA"),
Category = c("A", "B","A","B"),
Sales = c(103, 192, 144, 110))
ggplot(df, aes(fill=Category, y=Sales, x=Origin)) +
geom_bar(position="dodge", stat="identity") + coord_flip()