I would like to assign a serial number to duplicated values of a vector in R without using a for loop as shown in an example shown below. I have a big data set. Thanks
Va