rename_vars: Rename column names

View source: R/mutate.R

rename_varsR Documentation

Rename column names

Description

Rename columns of a dataset with desired names

Usage

rename_vars(data, tobe_asis)

Arguments

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')

Value

original dataframe containing new columns of the renamed columns with tidyverse code attached

Author(s)

Zhaoming Su

See Also

code

Examples

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)


iNZightTools documentation built on Oct. 12, 2023, 5:06 p.m.