I have a following dataset:
country_iso2 fraud_flag value
1 US 0 136
2 US 1 15
3 BR 0 130
4 BR 1 30
5 MX 0 96
6 MX 1 54
Based on it I have created a plot using:
p1<-ggplot(data=d,aes(x=country_iso2,y=value,fill=fraud_flag))+
geom_bar(position='dodge',stat='identity')
The plot looks like this:
How can I adjust my code so that bar groups are going in descending order based on orange bar. So in my case I want the order to be US,BR,MX.