gen_uniq_lbls-deprecated: Generate unique labels.

gen_uniq_lbls-deprecatedR Documentation

Generate unique labels.

Description

This function generates unique labels for an input vector by adding a count to labels of which multiple occurrences are found.

Usage

gen_uniq_lbls(lbls, sep_char = " ")

Arguments

lbls

A vector of labels for which to generate unique names.

sep_char

A (combination of) characters with which to separate labels and their unique counts.

Value

A factor of unique labels.

See Also

fantaxtic-deprecated

Examples

lbls <- as.character(c("A", "B", "B", "C", "C", "C", "D"))
gen_uniq_lbls(lbls)
gen_uniq_lbls(lbls, sep_char = "_")

#Also works with factors or numerics
gen_uniq_lvls(as.factor(lbls))
lbls <- as.numeric(c(1, 2, 2, 3, 3, 3, 4))
gen_uniq_lbls(lbls)

gmteunisse/Fantaxtic documentation built on June 7, 2024, 8:47 a.m.