title: Ordering categorical variables in a dataframe
body: <p>How to you change the order in which factors are displayed in a dataframe? </p>
  
  <p>Example data using a sample of Australian state names:</p>
  
  <pre><code>location &lt;- c("new_south_wales", "victoria", "queensland")
  </code></pre>
  
  <p>Say I want to have <code>victoria</code> appear last!</p>
  
  <pre><code>#this doesn't work
  factor(location, levels = c("new_south_wales", "queensland", "victoria")
  
  #neither does this
  ordered(location, levels = c("new_south_wales", "queensland", "victoria")
  </code></pre>
  
  <p>Also tried <code>forcats::fct_relevel</code> but, while I can change levels, it still doesn't have an impact on the order in which the factors are displayed.</p>