make_unique {uniqtag}R Documentation

Make character strings unique.

Description

Append sequence numbers to duplicate elements to make all elements of a character vector unique.

Usage

make_unique(xs, sep = "-")

make_unique_duplicates(xs, sep = "-")

make_unique_all(xs, sep = "-")

make_unique_all_or_none(xs, sep = "-")

Arguments

xs

a character vector

sep

a character string used to separate a duplicate string from its sequence number

Functions

See Also

make.unique

Examples

abcb <- c("a", "b", "c", "b")
make_unique(abcb)
make_unique_duplicates(abcb)
make_unique_all(abcb)
make_unique_all_or_none(abcb)
make_unique_all_or_none(c("a", "b", "c"))
x <- make_unique(abbreviate(state.name, 3, strict = TRUE))
x[grep("-", x)]

[Package uniqtag version 1.0.1 Index]