Learn R Programming

poorman (version 0.2.0)

rename: Rename columns

Description

rename() changes the names of individual variables using new_name = old_name syntax.

Usage

rename(.data, ...)

Arguments

.data

A data.frame

...

Comma separated key-value pairs in the form of new_name = old_name to rename selected variables.

Value

A data.frame

Examples

Run this code
# NOT RUN {
rename(mtcars, MilesPerGallon = mpg)
rename(mtcars, Cylinders = cyl, Gears = gear)
mtcars %>% rename(MilesPerGallon = mpg)

# }

Run the code above in your browser using DataLab