make_unique {makeunique} | R Documentation |
Append numbers to duplicate values to ensure all are unique
make_unique(
x,
sep = " ",
wrap_in_brackets = TRUE,
warn_about_type_conversion = TRUE
)
x |
vector to de-duplicate |
sep |
string separating (string) |
wrap_in_brackets |
should the number indicating order of duplicated elements be wrapped in round brackets? (flag) |
warn_about_type_conversion |
should the function warn user if input type is converted to 'character' in output (flag) |
Differs from 'make.unique' in base R by starting suffixes at 1 and allowing users to customize suffix format.
x but duplicated values are de-duplicated by adding a number corresponding to the order in which duplicates appear
make_unique(c('bob', 'billy', 'bob', 'bob'))