Description Usage Arguments Details Value Examples
Fix duplicated values in a character vector, useful in column names and some ID structures that requires unique identifiers. If any duplicated string is found in the vector, a numeric index will be added after the these strings.
1 | strUniquefy(x, sep_b = "_", sep_a = "", mark_first = TRUE)
|
x |
character vector |
sep_b |
string, separator before the number index |
sep_a |
string, separator after the number index |
mark_first |
bool, if duplicated values are found, do you want to add the
numeric index starting from the first copy? |
The input can also be a numeric vector, but the return will always be character.
returns a character vector
1 2 3 4 | strUniquefy(c(1,1,1,2,3))
strUniquefy(c(1,1,1,2,3), mark_first = FALSE)
strUniquefy(c(1,1,1,2,3), sep_b = "(", sep_a = ")")
strUniquefy(c("a","b","c","a","d","b"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.