title: get all rows that have a certain year
body: <p>I have this matrix that has the name of a person, the date of birth and their respective sex:</p>
  
  <pre><code>Name     Date          Sex
  A       2017-08-01      M
  B       2018-06-02      F
  C       2019-06-03      F
  </code></pre>
  
  <p>What I want to do in R is to get the number of people with name A that born in 2017 but I don´t know how.</p>
  
  <p>Here is my code so far, that gives us the people with the name A:</p>
  
  <pre><code>df[format(as.Date(matrix$Date),'%Y')=='2017' &amp; matrix$Name=='A', ]
  </code></pre>