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

makeNames(object, ...)

# S4 method for character
makeNames(object, unique = TRUE)

# S4 method for factor
makeNames(object, unique = TRUE)

Arguments

object

Object.

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().

...

Additional arguments.

Value

Modified object.

Details

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

Note

Updated 2020-01-27.

See also

Examples

data(syntactic, package = "acidtest") object <- syntactic$character makeNames(object)
#> [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"