title: Remove consecutive duplicates from dataframe
body: <p>I have a data frame that I want to remove duplicates that are consecutive (in base).  I know <code>rle</code> may be helpful here but can't think of how to use it.  The example output will help to illuminate what I'm asking for.</p>
  
  <p><strong>Generate sample data:</strong></p>
  
  <pre><code>set.seed(12)
  samps &lt;- sample(1:5, 20, T)
  dat &lt;- data.frame(v1=LETTERS[samps], v2=month.abb[samps])
  dat[10, 2] &lt;- "Mar"
  </code></pre>
  
  <p><strong>Sample data:</strong></p>
  
  <pre><code>   v1  v2
  1   A Jan
  2   E May
  3   E May
  4   B Feb
  5   A Jan
  6   A Jan
  7   A Jan
  8   D Apr
  9   A Jan
  10  A Mar
  11  B Feb
  12  E May
  13  B Feb
  14  B Feb
  15  B Feb
  16  C Mar
  17  C Mar
  18  C Mar
  19  D Apr
  20  A Jan
  </code></pre>
  
  <p><strong>Desired outcome:</strong></p>
  
  <pre><code>   v1  v2
  1   A Jan
  3   E May
  4   B Feb
  7   A Jan
  8   D Apr
  10  A Mar
  11  B Feb
  12  E May
  15  B Feb
  18  C Mar
  19  D Apr
  20  A Jan
  </code></pre>