| var_rename {sjmisc} | R Documentation |
This function renames variables in a data frame, i.e. it renames the columns of the data frame.
var_rename(x, ...)
x |
A data frame. |
... |
Pairs of named vectors, where the name equals the column name that should be renamed, and the value is the new column name. |
x, with new column names for those variables specified in ....
# Set variable labels for data frame
dummy <- data.frame(a = sample(1:4, 10, replace = TRUE),
b = sample(1:4, 10, replace = TRUE),
c = sample(1:4, 10, replace = TRUE))
var_rename(dummy, a = "first.col", c = "3rd.col")