title: Partial row by row matching of two vectors
body: <p>I would to like to indicate if <code>x</code> is contained in <code>y</code>, preferably without using a loop. I tried the following but it produces an error. </p>
  
  <pre><code>df$flag &lt;- ifelse(grep(df$x, df$y), 1, 0)
  </code></pre>
  
  <p>Here is the example:</p>
  
  <pre><code>df &lt;- data.frame(id=seq(1,3,1),x=c("abc","efd","xyz"), y=(c("abc,efd","hig,mno","abc,xyz")))
  </code></pre>