rename_vars | R Documentation |
Rename columns of a dataset with desired names
rename_vars(data, tobe_asis)
data |
a dataframe with columns to rename |
tobe_asis |
a named list of the old column names assigned to the new column names ie. list('new column names' = 'old column names') |
original dataframe containing new columns of the renamed columns with tidyverse code attached
Zhaoming Su
code
renamed <- rename_vars(iris, list(
sepal_length = "Sepal.Length",
sepal_width = "Sepal.Width",
petal_length = "Petal.Length",
petal_width = "Petal.Width"
))
cat(code(renamed))
head(renamed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.