make.unique(names, sep = ".")
| names | a vector of character strings. |
| sep | a character string used as a separator between a duplicate string and the appended sequence number. The default is ".". |
make.unique(c("a", "a", "a", "a"))
# "a" "a.1" "a.2" "a.3"
make.unique(c("a", "a", "a", "a.1"))
# "a" "a.2" "a.3" "a.1"
make.unique(c(make.unique(c("a", "a", "a")), "a"))
# "a" "a.1" "a.2" "a.3"
# unique vector A is not changed
A <- c("a","b","c")
B <- c("b","c","d")
make.unique(c(A,B))
# "a" "b" "c" "b.1" "c.1" "d"