title: Sorting ggplot barplot x-axis in descending order (only one variable on the x-axis)
body: <p>I have a big dataframe (AKA "all_data") of words that were presented as an Arabic audio to participants who then had to choose from four options what they thought the word meant in English. Their choice is recorded in the choice column, and what the correct answer should have been is in a different one:</p>
  
  <p><a href="https://i.stack.imgur.com/7a1XS.png" rel="nofollow noreferrer">Preview of my screen</a></p>
  
  <p>Anyway, I wanted to kind of add a column to this "all_data" df that shows their most frequent response even if it wasn't the target word, but I couldn't figure out how to do that. So, moving on, I atleast wanted to visualize it so I created barplots so I could individually check each of the 100 words to see what people thought this word sounded like--so I filtered the word in question (doing this for each of the 100 words is tedious I know) and then made the x-axis the "Choice" column as you can see in the code below:</p>
  
  <pre><code>ggplot(filter(all_data, Correct == "Stormy"), aes((Choice))) + geom_bar()
  </code></pre>
  
  <p>This leads to the bar plot you see on the bottom right of the print screen I showed. </p>
  
  <p>I tried several things to to rearrange the x-axis in order of frequency but nothing worked! I have searched on all the other threads similar to this question but they all have a y-axis to use in the reordering, which I do not have and therefore I always get errors.    </p>
  
  <p>I understand there is technically no defined y-axis so R kind of creates its own 'count' of the words on the x-axis but I can't seem to figure out how to get the name for this count in the y-axis as you can see in my so many attempts above. </p>
  
  <p>Anyway after all that I've just been viewing my plots in the normal way and making notes but is there anything anyone can do to help with any of my problems? </p>
  
  <p>Much appreciated!</p>
  
  <p>Ahsan</p>