title: Find the index of the column in data frame that contains the string as value
body: <p>I have data frame like this :</p>
  
  <pre><code>df &lt;- data.frame(col1 = c(letters[1:4],"a"),col2 = 1:5,col3 = letters[10:14])
   df
    col1 col2 col3
  1    a    1    j
  2    b    2    k
  3    c    3    l
  4    d    4    m
  5    a    5    n
  </code></pre>
  
  <p>I want to find the index of the column of <code>df</code> that has values matching to string "a".
  i.e. it should give me <code>1</code> as result.
  I tried using which in sapply but its not working.
  Anybody knows how to do it without a loop ??  </p>