How could I generate a new column listing repeated values? For example, this is my data frame:
id color
123 white
123 white
123 white
345 blue
345 blue
678 red
This is what I wanted:
# id color
1 123 white
1 123 white
1 123 white
2 345 blue
2 345 blue
3 678 red