For atomic
vectors, these functions will sanitize the values. Otherwise,
they will set names()
, rownames()
,
and/or colnames()
without modification of the values.
Usage
makeNames(object, ...)
# S4 method for character
makeNames(object, unique = TRUE, smart = FALSE)
# S4 method for factor
makeNames(object, unique = TRUE, smart = FALSE)
Arguments
- object
Object.
- unique
logical(1)
. IfTRUE
, the resulting elements are unique. Recommended by default, for syntactically valid names (e.g. column, row names). Note that this is disabled by default formake.names()
.- smart
logical(1)
. Handle complicated special cases, such as mixed case acronyms, plus/minus, percentages, etc.- ...
Additional arguments.
Details
Sanitizes names using underscores instead of dots, the convention used by
make.names()
.
Examples
data(syntactic, package = "AcidTest")
object <- syntactic[["character"]]
makeNames(object)
#> [1] "GC" "X10uM" "X5_3_bias" "X5prime"
#> [5] "G2M_Score" "hello_world" "HELLO_WORLD" "Mazda_RX4"
#> [9] "nCount" "RNAi_clones" "tx2gene" "TX2GeneID"
#> [13] "worfdbHTMLRemap" "X123"