renameColumns: Renames variables in a data frame.

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

Renames variables in a data frame.

Usage

1
renameColumns(x, from = "", to = "")

Arguments

x

data frame to be modified.

from

character vector containing the current names of each variable to be renamed.

to

character vector containing the new names of each variable to be renamed.

Value

The updated data frame x where the variables listed in from are renamed to the corresponding to column names.

See Also

colnames, recoder

Examples

1
2
x <- data.frame(x = 1:4, y = LETTERS[1:4])
renameColumns(x, from = c("x","y"), to = c("digits","letters"))

ETLUtils documentation built on Aug. 3, 2020, 5:16 p.m.