title: r search value in row
body: <p>how can I search for specific values in a line. E.g., for this data</p>
  
  <pre><code> a &lt;- c("a", "a", "b", "c")
   b &lt;- c("b", "a", "b", "d")
   c &lt;- c("c", "a", "b", "c")
   d &lt;- c("a", "a", "b", "a")
   x &lt;- data.frame(cbind(a,b,c,d))
   head(x)
  </code></pre>
  
  <p>I would like to know if there is an "a", "b", "c", or "d" in the first row. The optimal result would look like additional columns that indicate how many are in each row. </p>
  
  <p>Thanks again! </p>