ren_many: Rename Many Columns

View source: R/ren_many.R

ren_manyR Documentation

Rename Many Columns

Description

Rename many columns using a named vector.

Usage

ren_many(data, ren, ignore_case = TRUE)

Arguments

data

Dataframe.

ren

Named character vector with c("new name" = "old name").

ignore_case

Ignore case if TRUE (default).

Details

Rename many columns using a named character vector where the names are the new name and the element the old name. See the example.

Value

Dataframe with new names.

Examples

df <- iris
df <- ren_many(df,
 ren = c("sepal.length" = "Sepal.Length", "flower" = "Species"))
stopifnot(identical(
 names(df),
 c("sepal.length", "Sepal.Width", "Petal.Length", "Petal.Width", "flower")
 ))

FrankLef/eflMuncher documentation built on July 9, 2022, 11:43 a.m.