How can I assign ID numbers based on two variables, A and B. It would be helpful if the code can handle multiple variables.
Here is what my data look like:
A B ID
5000136 5 1
5000136 5 1
5000225 4 2
5000225 4 2
5000225 4 2
5000225 6 3
5000225 6 3
5000225 6 3
5000327 2 4
5000327 2 4
....
ID is the result I want to produce.
Thanks in advance and I’m sorry if this question is duplicate.
1 Answer