> dput(Data)
structure(list(DISTRICT = c("KARIMGANJ", "KARIMGANJ", "KARIMGANJ",
"KARIMGANJ", "KARIMGANJ", "HAILAKANDI", "HAILAKANDI", "HAILAKANDI",
"CACHAR", "CACHAR")), row.names = c(NA, -10L), class = "data.frame")
I want to create Unique IDs I have >thousand rows but logic will be same I guess. How do I create this new column as shown in the expected output? Note that sequence can be of 7 digits as well.
#
DISTRICT ID
1 KARIMGANJ 1111
2 KARIMGANJ 1111
3 KARIMGANJ 1111
4 KARIMGANJ 1111
5 KARIMGANJ 1111
6 HAILAKANDI 1112
7 HAILAKANDI 1112
8 HAILAKANDI 1112
9 CACHAR 1113
10 CACHAR 1113