title: In R, select a group of rows and filter
body: <p>I have a data frame</p>
  
  <blockquote>
    <p>D</p>
  </blockquote>
  
  <pre><code>    col1 col2
  1     2    8
  2     2   10
  3     2   10
  4     2   19
  5     5   16
  6     7   15
  7     5    8
  8     5   10
  9     5    1
  10    5   19
  11    1   16
  12    1   15
  </code></pre>
  
  <p>I would like to select from col1 == 2, the rows where col2==8 and col2==19, at the same time, select from col1==5, the rows where col2 == 1 and col2==19. In other words, i want some like this</p>
  
  <blockquote>
    <p>D</p>
  </blockquote>
  
  <pre><code>    col1 col2
  1     2    8
  4     2   19
  9     5    1
  10    5   19
  </code></pre>
  
  <p>In my other case, i have a big data set with many rows and I would like to select many groups of the col1 and for each group, sequential codes of the col2. 
  I would like too, some code working with character columns</p>