title: Filter & Subset if a String Contains Certain Characters (in R)
body: <p>I currently wish to divide a data frame into subsets for training/testing.  In the data frame there are columns that contain different items, and some contain sub-items like (Aisle01, Aisle02, etc.)  I am getting tripped up by filtering out a partial string in multiple columns.  </p>
  
  <p>Data sample:</p>
  
  <pre><code>Column1   Column2  Column3
  
  Wall01    Wall04   45.6
  Wall04    Aisle02  65.7
  Aisle06   Wall01   45.0
  Aisle01   Wall01   33.3
  Wall01    Wall04   21.1
  </code></pre>
  
  <p>If my data frame (x) contains two columns that within them contain multiple version of "Aisle", I wish to filter out everything from both columns that contains "Aisle".  Wondering if the line below is somewhat on the right track?</p>
  
  <blockquote>
    <blockquote>
      <p>filter(x, column1 &amp; column2 == grep(x$column1 &amp; x$column2, "Aisle"))</p>
    </blockquote>
  </blockquote>
  
  <p>Desired result:</p>
  
  <pre><code>Column1  Column2  Column3
  
  Wall04   Aisle02  65.7
  Aisle06  Wall01   45.0
  Aisle01  Wall01   33.3
  </code></pre>
  
  <p>Thank you in advance.</p>