title: Subset specific dates (year and month) from data.frame
body: <p>Here my data.frame:</p>
  
  <pre><code>df = read.table(text = 'ID   Date
  1      1975-01-01
  2      1980-02-01
  3      1985-05-01
  4      1990-07-01
  5      1990-08-01
  6      1993-01-01
  7      1993-09-01', header = TRUE)
  </code></pre>
  
  <p>I need to create a subset from it by selecting specific dates (year and month). </p>
  
  <p>The dates I am interested are:</p>
  
  <pre><code>dates = c('1980-02', '1990-07', '1993-09')
  </code></pre>
  
  <p>and therefore my output should be:</p>
  
  <pre><code>ID     Date
  2      1980-02-01
  4      1990-07-01
  7      1993-09-01
  </code></pre>
  
  <p>Is there any possibility to write a unique code that do the trick starting from <code>df</code> and <code>dates</code>, without add manually the dates in the code?</p>
  
  <p>Thanks</p>
  
  ####UPDATE
  
  <p>What if I have got multiple observations in the same month within <code>df</code>, like:</p>
  
  <pre><code>df2 = read.table(text = 'ID   Date
  1      1975-01-01
  2      1980-02-01
  9      1980-02-01
  3      1985-05-01
  4      1990-07-01
  12     1990-07-01
  16     1990-07-01
  5      1990-08-01
  6      1993-01-01
  7      1993-09-01
  67     1993-09-01', header = TRUE)
  </code></pre>
  
  <p>New output:</p>
  
  <pre><code>ID     Date
  2      1980-02-01
  9      1980-02-01
  4      1990-07-01
  12     1990-07-01
  16     1990-07-01
  7      1993-09-01
  67     1993-09-01
  </code></pre>
  
  <p>Thanks</p>