title: Using grepl with variable
body: <p>I have a large data frame and want to select certain columns. </p>
  
  <p>Is it possible to select strings and numeric values of the colum names with a short command?
  In python it would be 'b'+str(j). I tried as.characater(j), but it did not help.</p>
  
  <pre><code>a=c(1:4)
  ab1=c(1,1,1,1)
  ab2=c(2,1,1,1)
  ab3=c(3,1,1,1)
  dat &lt;- data.frame(a,ab1,ab2,ab3)
  for (j in c(1:3)) {
    new_dat &lt;- dat[grepl('b'&amp;j), names(dat)] #this does not work: Just to indicate what i want
      #do something
  }
  </code></pre>