title: Reorder factor levels by day of the week in R
body: <p>I have the following data.frame in R:</p>
  
  <pre><code>&gt; daily
          DoW         Duration
  1    Friday 14.0000000000000
  2    Monday 21.0000000000000
  3  Saturday 12.0000000000000
  4  Thursday 28.0000000000000
  5   Tuesday 12.0000000000000
  6 Wednesday 91.0000000000000
  7    Sunday 20.0000000000000
  </code></pre>
  
  <p>I'd like to change the order of the factor levels so that the weeks are in (US) day-of-week order.</p>
  
  <p>It looks like I can do this in a slow, puzzling way with <code>relevel()</code>.  But this only takes 1 numeric argument and moves it to the top.  So, <code>relevel(daily$DoW, 7)</code>, moves Sunday to the top, but the rest remain unordered (which means I need to relevel it in reverse order).</p>
  
  <p>Doable, but there must be a better way, right?  </p>
  
  <p>(Time series solution also acceptable.)</p>