title: Count multiple patterns using the str_count function in R
body: <p>Fairly new to R and struggling a bit with using the <code>string_count</code> function to detect multiple words that are unknown and are contained within a separate vector.</p>
  
  <p>Now, I know how to detect a single instance of a pattern using the following code:</p>
  
  <pre><code>str_count(mydf$string, "Apples")
  </code></pre>
  
  <p>What I want to do is detect multiple words (e.g. "Apples", "Pears", "Oranges" etc) from a vector that is in itself created from another data frame (e.g. by using <code>Uniques&lt;-unique(mydf1$words)</code>). </p>
  
  <p>The key thing here is that the words that appear in <code>mydf1$words</code> are entirely dependent on what data has been uploaded to R in the first place, as this will change from data set to data set.</p>
  
  <p>The answer is probably pretty straight forward but for the life of me I cant seem to work it out! </p>