title: Add a second to duplicated POSIXct dates
body: <p>I am trying to add single seconds to any repeated dates in my data frame.</p>
  
  <p>i.e. from this:</p>
  
  <pre><code>       value                date
         18        2013-07-09 16:49:23
         62        2013-07-09 18:01:36
         64        2013-07-09 18:46:51
         29        2013-07-09 18:46:51
         22        2013-07-09 18:46:51
  ....
  </code></pre>
  
  <p>I would like to obtain this:</p>
  
  <pre><code>       value                date
         18        2013-07-09 16:49:23
         62        2013-07-09 18:01:36
         64        2013-07-09 18:46:51
         29        2013-07-09 18:46:52
         22        2013-07-09 18:46:53
  ....
  </code></pre>
  
  <p>I understand I can simply add + 1 or +2 to the POSIXct format to add seconds- however I don't know how to select the duplicates. Note that my dataframe is a few hundred of rows long, and a date can appear up to 20 times in a row.</p>
  
  <p>I am thinking of doing something along these lines:</p>
  
  <pre><code>for (item in duplicated(dataframe$date)) {
      if (item == TRUE) {
          for (n in 1:#length of duplicated dates) {
          dataframe[index(item) +n]$date &lt;- (dataframe[index(item) +n]$date +n)
          } } }
  </code></pre>
  
  <p>Thank you for your help!</p>