title: R: Reorder levels of a factor alphabetically but one
body: <p>I would like to re-order the levels of a factor so the new order displays all the values alphabetically except one (Other) which I would like it to be the last one.</p>
  
  <p>Let's imagine we have this factor:</p>
  
  <pre><code>x &lt;- factor(c("Yes", "No", "Other", "Yes", "No", "Other"))
  
  &gt; x
  [1] Yes   No    Other Yes   No    Other
  Levels: No Other Yes
  </code></pre>
  
  <p>I would like their levels to be displayed in this order: "Yes", "No", "Other", instead of the default one. I know in this silly example I could easily achieve that by doing:</p>
  
  <pre><code>x2 &lt;- factor(c("Yes", "No", "Other", "Yes", "No", "Other"), 
               levels = c("Yes", "No", "Other"))
  </code></pre>
  
  <p>Which would result in what I wanted:</p>
  
  <pre><code>&gt; x2
  [1] Yes   No    Other Yes   No    Other
  Levels: Yes No Other
  </code></pre>
  
  <p>But that would not be so funny if we had a vector with several different levels and we don't want to write them again, after all their order is fine except for one!</p>
  
  <p>Is there any better way to solve this without having to write the whole vector from scratch?</p>