title: R loop for with grep function
body: <p>Following code does not work:</p>
  
  <p>I would like to loop over a list of word (array mdf) and find the number of occurences for each word in this list (mdf) in another list of words (array mydf). 
  Thanks for your feedback!</p>
  
  <pre><code>for (x in mdf)
        { print 
        ( length(grep('x',mydf)))
     }
  </code></pre>