title: Creating a column in r that auto-increments based on other columns
body: <p>My data frame has the customerID, product and date. I need to create a column that generates a transaction id everytime the customerID or the date changes.</p>
  
  <p>My dataframe currently looks like:</p>
  
  <ol>
  <li>CustomerID-Product--date</li>
  <li>23-------------abv-------12-12-14</li>
  <li>23-------------gfs--------12-12-14</li>
  <li>18-------------gra--------12-12-14</li>
  <li>52-------------wer--------14-12-14</li>
  <li>23-------------qwe-------16-12-14</li>
  </ol>
  
  <p>I need the transactionID column to get populated using r </p>
  
  <ol>
  <li>CustomerID-Product--date----------transactionID</li>
  <li>23-------------abv-------12-12-14----1</li>
  <li>23-------------gfs--------12-12-14----1</li>
  <li>18-------------gra-------12-12-14----2</li>
  <li>52-------------wer-------14-12-14----3</li>
  <li>23-------------qwe------16-12-14----4</li>
  </ol>
  
  <p>I have the data in a csv file. I am not able to create this column in excel as the file is too big and excel is unable to open the entire file.</p>
  
  <p>Thank you for your help!</p>