title: Count the number of consecutive days of activity
body: <p>I'm relatively new to R and have used stackoverflow to solve a number of problems, but this is the first time I can't find a straightforward solution.  Would really appreciate help on this.</p>
  
  <p>PROBLEM (simplified):  I have a data frame with a field for <code>account.id</code> and a field for <code>start.date</code>.  There may be multiple records per day.  I want to create a third field called <code>sequential.days</code> which reports the number of sequential days a user (<code>account.id</code>) has been active.</p>
  
  <p>DETAILS:  The data is already sorted by <code>account.id</code> and then by <code>start.date</code>.  There can be multiple records per day.  If there are multiple records in a single day, I would like <code>sequential.days</code> to populate with a value of 1.</p>
  
  <p>Thanks.</p>
  
  <p>Here is a "working example" -- meaning that it includes an illustration of the data and the field I'd like to generate.</p>
  
  <pre><code>id &lt;- c(1030, 1030, 1030, 1030, 2022, 2022, 2022, 2022, 3045, 3045, 3045, 3045)
  date &lt;- c('2013-01-01', '2013-01-01', '2013-01-02', '2013-02-04', '2013-02-01', '2013-02-02', '2013-02-02', '2013-01-04', '2013-05-01', '2013-06-01',  '2013-07-01', '2013-07-01')
  sequential.days &lt;- c(1,1,2,1,1,2,2,1,1,1,1,1)
  df &lt;- cbind(id, date, sequential.days)
  </code></pre>