title: Keeping rows from the previous year
body: <p>I am just going to give it a try as I know that here are some smart people who might have an r -code for this.
  I wont be able to code this by myself.</p>
  
  <p>So I got a dataset that contains the names and years-months between 2000-01 and 2008-12. Looking like this:</p>
  
  <pre><code> Name      Date
   A         2000-01
   A         2000-02
   A          ...
   A         2008-12
   A         2000-01
   B         2000-01
   B          ...
   B         2008-12
   C         and so on..
  </code></pre>
  
  <p>It can happen that for each name in my key column there is one value for each year. Thats the best I can ask for. Unfortunately some years dont have a value in my key column.
  Getting further in my dataset looking only at Name A:</p>
  
  <p>So if I do not have 1 observations for every year between 2000-2008 and I want to get the row from the year and month that does not have a value for my key column based on the month from the year on the next observation.
  In this example:</p>
  
  <p>2003-02 has a value for my keycolumn and 2002-02 does not, I want to get back the row from the date 2002-02 and Name A.
  In a nutshell: "Keeping rows from the previous year based on key column from the next year"</p>
  
  <p>Is there some easy way to code this?
  Thank you :)</p>