make.names {base} R Documentation

Make Syntactically Valid Names

Description


Make syntactically valid names out of character vectors.

Usage

make.names(names,
    unique = FALSE,
    allow. = 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. [as boolean]

allow.

logical. For compatibility with R prior to 1.9.0. [as boolean]

Details

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.

Authors

SMRUCC genomics Institute

Value

A character vector of same length as names with each changed to a syntactically valid name, in the current locale's encoding.

clr value class

Examples


[Package base version 2.33.856.6961 Index]