title: matching text with dataframe column in r
body: <p>I have a vector of word in r.</p>
  
  <pre><code>words = c("Awesome","Loss","Good","Bad")
  </code></pre>
  
  <p>And,I have following dataframe in r</p>
  
  <pre><code>ID           Response
  1            Today is an awesome day
  2            Yesterday was a bad day,but today it is good
  3            I have losses today
  </code></pre>
  
  <p>What I want to do is words that are matching in Response column should be extracted and inserted into new column in dataframe. Final output should look like this</p>
  
  <pre><code>ID           Response                        Match          Count 
  1            Today is an awesome day        Awesome           1
  2            Yesterday was a bad day        Bad,Good          2 
               ,but today it is good      
  3            I have losses today             Loss             1
  </code></pre>
  
  <p>I did following in r</p>
  
  <pre><code>sapply(words,grepl,df$Response)
  </code></pre>
  
  <p>It matches the words,but how would I get my dataframe in desired format?
  Please help.</p>