Skip to contents

Remove duplicate values from a character vector.

Usage

chr_unique(strings)

Arguments

strings

A character vector, where each element of the vector is a character string.

Value

A character vector, usually shorter than strings, containing only distinct values.

See also

unique() which this function wraps around

Examples

chr_unique(c("a", "b", "a", "c"))
#> [1] "a" "b" "c"