title: Aggregate if string contains specific text in R
body: <p>I've seen a lot of posts on this topic so apologies if this is a duplicate but I couldn't figure out my problem.</p>
  
  <p>I have</p>
  
  <pre><code>df &lt;- data.frame(name = c('bike+ride','shoe+store','ride','mountian%20bike','ride+along'),
               count = c(2,5,8,7,6))
  </code></pre>
  
  <p>and want to sum each <code>count</code> if it <code>name</code> contains a string <code>group</code></p>
  
  <pre><code>group &lt;- data.frame(group = c('ride','bike'))
  </code></pre>
  
  <p>So the end result looks as follows:</p>
  
  <pre><code>Group   Count
  bike      9
  ride     16
  </code></pre>
  
  <p>Can anyone help?</p>