title: Arranging rows in custom order using dplyr
body: <p>With <code>arrange</code> function in <code>dplyr</code>, we can arrange row in ascending or descending order. Wonder how to arrange rows in custom order. Please see MWE.</p>
  
  <pre><code>Reg &lt;- rep(LETTERS[1:3], each = 2)
  Res &lt;- rep(c("Urban", "Rural"), times = 3)
  set.seed(12345)
  Pop &lt;- rpois(n = 6, lambda = 500000)
  df &lt;- data.frame(Reg, Res, Pop)
  
  df
     Reg   Res    Pop
  1    A Urban 500414
  2    A Rural 500501
  3    B Urban 499922
  4    B Rural 500016
  5    C Urban 501638
  6    C Rural 499274
  
  df %&gt;%
    arrange()
  </code></pre>
  
  <p><strong>Desired Output</strong></p>
  
  <pre><code>   Reg   Res    Pop
  5    C Urban 501638
  6    C Rural 499274
  1    A Urban 500414
  2    A Rural 500501
  3    B Urban 499922
  4    B Rural 500016
  </code></pre>