title: R delete last row in dataframe for each group
body: <p>I would like to delete the last row in a dataframe for each group in R based on max(start_date).</p>
  
  <p>Example data:</p>
  
  <pre><code>id      start_date  end_date
  1       2016-01-14  2016-02-14
  1       2016-03-14  2016-08-05
  2       2014-01-14  2014-02-14
  2       2015-03-21  2015-05-21
  2       2015-08-23  2015-09-23
  2       2015-11-21  2016-01-03
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>id      start_date  end_date
  1       2016-01-14  2016-02-14
  2       2014-01-14  2014-02-14
  2       2015-03-21  2015-05-21
  2       2015-08-23  2015-09-23
  </code></pre>
  
  <p>The following does not work:</p>
  
  <pre><code>df &lt;- df %&gt;% 
     group_by(id) %&gt;% 
     summarise(start_date != max(start_date))
  </code></pre>
  
  <p>Error: found duplicated column name: id</p>
  
  <pre><code>df &lt;- sqldf("select * from df group by id having start_date != max(start_date)")
  </code></pre>
  
  <p>error in statement: duplicate column name: id</p>
  
  <p>Any suggestions would be great.</p>