I am making a dodged bar chart using ggplot with discrete x scale, the x axis is now arranged in alphabetical order, but I need to rearrange it so that it is ordered by the value of the y-axis (i.e., the tallest bar will be positioned on the left).
I tried to order or sort, but resulted in sorting the x-axis, but not the bars respectively.
What have I done wrong?