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 vector to be coerced to syntactically valid names. This is coerced to character if necessary.

unique

logical; if TRUE, the resulting elements are unique. This may be desired for, e.g., column names.

Value

character.

Note

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

See also

Examples

load(system.file("extdata", "mn.rda", package = "syntactic")) names <- mn$character makeNames(names)
#> [1] "hello_world" "HELLO_WORLD" "RNAi_clones" "nCount" #> [5] "tx2gene" "TX2GeneID" "G2M_Score" "worfdbHTMLRemap" #> [9] "Mazda_RX4" "X_GC" "X5prime" "X5__3__bias" #> [13] "X123" "NA_"