Learn R Programming

questionr (version 0.7.8)

rename.variable: Rename a data frame column

Description

Rename a data frame column

Usage

rename.variable(df, old, new)

Value

A data frame with the column named "old" renamed as "new"

Arguments

df

data frame

old

old name

new

new name

Examples

Run this code
data(iris)
str(iris)
iris <- rename.variable(iris, "Species", "especes")
str(iris)

Run the code above in your browser using DataLab