title: Select rows with a partial string match of two columns in R?
body: <p>I am working with a dataset similar to the following:</p>
  
  <pre><code>data&lt;- tibble('year' = c(1850,1860,1870), 'TallestPerson' = c('Abe Lincoln', 'Abe 
  Lincoln', 'Paul Bunyon'), 'President'=c('Taylor', 'Lincoln', 'Grant'))
  </code></pre>
  
  <p>In table form:</p>
  
  <pre><code>    year  TallestPerson  President
  1   1850  Abe Lincoln    Taylor
  2   1860  Abe Lincoln    Lincoln
  3   1870  Paul Bunyon    Grant
  </code></pre>
  
  <p>I'm looking for a way to select the second row of this table due to the the President's name being part of the tallest person's name.</p>
  
  <p>I have attempted </p>
  
  <pre><code>tall_presidents &lt;- data %&gt;% filter(data$President %in% data$TallestPerson)
  </code></pre>
  
  <p>This returns an empty tibble, due to (I assume) the TallestPerson and President not matching exactly. How can I select the rows where the presidents name is contained in the tallest person's name?</p>
  
  <p>If this were SQL, the statement I am looking for would be </p>
  
  <pre><code>SELECT *
  FROM data
  WHERE TallestPerson LIKE "%"+President+"%"
  </code></pre>