make.names {base} | R Documentation |
Make syntactically valid names out of character vectors.
make.names(names,
unique = FALSE,
allow. = TRUE);
A syntactically valid name consists of letters, numbers and the dot or underline characters and starts with a letter or the dot not followed by a number. Names such as ".2way" are not valid, and neither are the reserved words.
The definition Of a letter depends On the current locale, but only ASCII digits are considered To be digits.
The character "X" Is prepended If necessary. All invalid characters are translated To ".". A missing value Is translated To "NA". Names which match R keywords have a dot appended To them. Duplicated values are altered by make.unique.
A character vector of same length as names with each changed to a syntactically valid name, in the current locale's encoding.