Create a set of valid names (trimmed, no duplicates, not starting with a number).

validNames(x, prefix='layer')

Arguments

x

character

prefix

character string used if x is empty

Value

character

See also

Examples

validNames(c('a', 'a', '', '1', NA, 'b', 'a'))
#> [1] "a.1"     "a.2"     "layer.1" "X1"      "layer.2" "b"       "a.3"