title: subset all rows with the same value in one column, grouped by another column, where at least one row of third column contains a specific letter in R
body: <p>I am gathering data from a database, where I have two different ID identifiers (ID1, Nr). I want to collect all the rows, that have duplicated ID1, grouped by "Nr", WHERE at least one record in Names has a letter "a".  </p>
  
  <pre><code>df &lt;- data_frame(ID1 = c('100', '100', '100', '100', '100', '100', '100', '100', '100'),
                   Nr = c('1', '1', '1', '2', '2', '2', '2', '3', '4'),
                   Names = c('aaa bb', 'aa bbb', 'ccc', 'ccc', 'ccc', 'ddd', 'ccc', 'ccc', 'add'))
  </code></pre>
  
  <p>So, the desired output would be:</p>
  
  <pre><code>output &lt;- data_frame(ID1= c('100', '100', '100', '100'),
                       Nr = c('1', '1', '1', '4'),
                       Names = c('aaa bb', 'aa bbb', 'ccc', 'add'))
  </code></pre>
  
  <p>Thank you in advance!</p>