title: R: Find where one variables contains the value of another
body: <p>Working in R.  I want to look at one variable to see if it contains the contents of another.  This needs to be done element by element.  </p>
  
  <pre><code>df1 &lt;- data.frame(
           FirstName = c("Jon", "Rob", "Phil", "Andy"),
           BusName = c("Jon's Auto", "123 Taxis", "Plumber Phil", "Handy 
  Plumbers")
  </code></pre>
  
  <p>I have tried lots of variations of grep/grepl/match/%in%/sub but this seems to only match a static string against the variable.  eg </p>
  
  <pre><code>grep("Jon",df1$BusName) would give me TRUE,FALSE,FALSE,FALSE but 
  grep(df1$FirstName, df1$BusNAme) gives an error
  </code></pre>
  
  <p>I want to scan down and compare them element by element so the output would be TRUE, FALSE, TRUE, FALSE</p>