title: Pasting into tidyverse's select()
body: <p>The dataset I am working on looks like this</p>
  
  <pre><code>a   b     vara_1 vara_2 vara_3 vara_4 vara_5 .... varb_1 varb_2 varb_3 varb_4
  -----------------------------------------------------------------------------
  100 120   a      b      c      d      e           w      x      y      z
  </code></pre>
  
  <p>I would like to change the column order of a dataset according to this particular order generated by the <code>paste0</code> function:</p>
  
  <pre><code>&gt; paste0(c("vara_", "varb_"),rep(1:10, each=2))
   [1] "vara_1"  "varb_1"  "vara_2"  "varb_2"  "vara_3"  "varb_3"  "vara_4"  "varb_4"  "vara_5"  "varb_5" 
  [11] "vara_6"  "varb_6"  "vara_7"  "varb_7"  "vara_8"  "varb_8"  "vara_9"  "varb_9"  "vara_10" "varb_10"
  </code></pre>
  
  <p>so the final look of the dataset would become</p>
  
  <pre><code>a   b     vara_1 varb_1 vara_2 varb_2 vara_3 varb_3 ....
  -----------------------------------------------------------------------------
  100 120   a      w      b      x      c      y  ....
  </code></pre>
  
  <p>is there anyway to put this into a format readable by tidyverse's <code>select()</code> function?</p>
  
  <p>I have tried </p>
  
  <pre><code>condition &lt;- paste0(c("vara_", "varb_"),rep(1:10, each=2)
  data &lt;- data %&gt;% select(a, b, condition)
  </code></pre>
  
  <p>and also <code>data &lt;- data %&gt;%  noquote(select(a, b, condition))</code> with no luck.</p>
  
  <p>Is the approach of listing out all the variable/ column orders possible for <code>select()</code>? Any help or alternative way of achieving the same goal is appreciated!</p>