For atomic vectors, these functions will sanitize the values. Otherwise, they will set names(), rownames(), and/or colnames() without modification of the values.

makeNames(names, unique = TRUE)

Arguments

names

character. Character vector to be coerced to syntactically valid names.

unique

logical(1). If TRUE, the resulting elements are unique. Recommended by default, for syntactically valid names (e.g. column, row names). Note that this is disabled by default for make.names().

Value

character.

Note

makeNames() sanitizes names using underscores instead of dots, the convention used by make.names().

Updated 2019-09-09.

See also

Examples

data(syntactic, package = "acidtest") names <- syntactic$character makeNames(names)
#> [1] "X_GC" "X10uM" "X5__3__bias" "X5prime" #> [5] "G2M_Score" "hello_world" "HELLO_WORLD" "Mazda_RX4" #> [9] "nCount" "RNAi_clones" "tx2gene" "TX2GeneID" #> [13] "worfdbHTMLRemap" "X123" "NA_"