0

I have requirement for sequence generation in R, but it needs to be unique in combination with another field. For example, my data:

GrpID   Data   NewSeqId
100     683      1
100     534      2 
100     234      3
200     456      1
200     23       2
200     634      3

So my data contains GrpID and Data, i need the NewSeqID generated as per the above shown pattern. It should start from 1 for every unique GrpID. Any ideas on how to get this done in R??

talat
  • 68,970
  • 21
  • 126
  • 157
  • See [here](http://stackoverflow.com/questions/9961700/how-to-partition-when-ranking-on-a-particular-column) and [here](http://stackoverflow.com/questions/15170777/add-a-rank-column-to-a-data-frame). – zx8754 Jun 01 '15 at 13:25
  • @zx8754 it doesn't look like a ranking problem, rather a simple sequence per group. – David Arenburg Jun 01 '15 at 13:28

0 Answers0