title: R: Removing multiple columns from data frame based on vector values
body: <p>I have a data frame dataGL_all: </p>
  
  <pre><code>Date&lt;-c("01-01-15 04:00","01-01-15 04:20","01-01-15 04:40")
  FLIin&lt;-c(96,39,72)
  FLIout&lt;-c(173,147,103)
  FBEin&lt;-c(96,116,166)
  FBEout&lt;-c(32,53,120)
  dataGL_all&lt;-data.frame(Date, FLIin, FLIout, FBEin, FBEout)
  </code></pre>
  
  <p>Furthermore, I have a vector:</p>
  
  <pre><code>Remove &lt;- c("FBEin", "FLIout")
  </code></pre>
  
  <p>I would a piece of code that removes the columns in the vector Remove from the data frame dataGL_all. I have tried many combinations of functions (e.g. grep(), c() and names()) but can't get it working ... would appreciate help :) thx</p>
  
  <p>P.S. My "real" data frame contains 68 columns where of I would like to remove 36 (the ones in the vector).</p>