title: Sort list by names stored in vector
body: <p>I have a named list:</p>
  <p><strong>The_list</strong></p>
  <pre><code>$df1
  
      col1  col2
  1   M     P
  2   N     Q
  3   O     R
  
  $df2
  
      col1  col2
  1   G     J
  2   H     K
  3   I     L
  
  $df3
  
      col1  col2
  1   A     D
  2   B     E
  3   C     F
  </code></pre>
  <p>How could I do a custom (i.e. not alphabetical) sort of the list by names that is stored in a vector:</p>
  <pre><code>order &lt;- c(&quot;df2&quot;, &quot;df3&quot;, &quot;df1&quot;)
  </code></pre>
  <p>and then get :</p>
  <p><strong>The_list</strong></p>
  <pre><code>$df2
  
      col1  col2
  1   G     J
  2   H     K
  3   I     L
  
  $df3
  
      col1  col2
  1   A     D
  2   B     E
  3   C     F
  
  
  $df1
  
      col1  col2
  1   M     P
  2   N     Q
  3   O     R
  </code></pre>
  <p>So far I tried:</p>
  <pre><code>The_list[order(c(&quot;df2&quot;, &quot;df3&quot;, &quot;df1&quot;))]
  </code></pre>