renameVars {iNZightTools} | R Documentation |
Rename column names and returns the result along with tidyverse code used to generate it.
renameVars(.data, to_be_renamed_list)
.data |
a dataframe with columns to rename |
to_be_renamed_list |
a list of the new column names assigned to the old column names ie. list('old column names' = 'new column names') |
original dataframe containing new columns of the renamed columns with tidyverse code attached
Owen Jin
renamed <- renameVars(iris,
to_be_renamed_list = list(Species = "Type", Petal.Width = "P.W"))
cat(code(renamed))
head(renamed)