I have a similar code like below, this was posted by someone else - but, I have an exact same problem, I need row numbers to repeat across repeating invoice numbers.
I am new to R so I what ever I tried doesn't seem to work as intended.
Sl invoice
1 A001
2 A002
2 A002
2 A002
2 A002
2 A002
2 A002
2 A002
3 A003
3 A003
4 A004
4 A004
4 A004
4 A004
5 A007
5 A007