title: conditionally remove a column in a data frame?
body: <p>I would like to remove the column in which there is an &quot;o&quot;</p>
  <pre><code>  Var1 Var2 Var3
  1    o    o    o
  2 Var1    o    o
  3    o Var2    o
  4 Var1 Var2    o
  5    o    o    o 
  6 Var1    o    o
  7    o Var2    o
  8 Var1 Var2    o
  </code></pre>
  <p>The problem is that I have several tables and the position of the column that contains the &quot;o&quot; is different in each data frame. I would like to know a way to conditionally remove the columns with &quot;o&quot;, since in the different tables the column is in a different position. Could be by evaluating the first row since the whole column is full of &quot;o&quot;.</p>
  <p>The output would look like</p>
  <pre><code>  Var1 Var2 
  1    o    o    
  2 Var1    o    
  3    o Var2    
  4 Var1 Var2    
  5    o    o     
  6 Var1    o    
  7    o Var2    
  8 Var1 Var2    
  </code></pre>