renameColumns {PDATK} | R Documentation |
Rename columns or do nothing if the names don't match
renameColumns(x, values)
x |
An object for which |
values |
A character vector where names are the old column names
and values are the new column names. Uses |
x
with the updated column names if they are present. Does not
fail if the column names are missing.
x <- data.frame(a=factor(LETTERS[1:5]), b=factor(runif(5, 0, 1))) renameColumns(x, c(a='c'))