Dear all,

I want to replace an (unsorted) id variable in a large dataset by a running
number without changing the order of the cases.

E.g.,

y <- c(4,4,4,2,45,12,12)

should be replaced by something like

x <- c(1,1,1,2,3,4,4)

Sorry for this simple question  & thank you very much for your help!

 

 


	[[alternative HTML version deleted]]

