rename_dt: Rename column in data.frame

View source: R/rename_dt.R

rename_dtR Documentation

Rename column in data.frame

Description

Rename one or more columns in the data.frame.

Usage

rename_dt(.data, ...)

rename_with_dt(.data, .fn, ...)

Arguments

.data

data.frame

...

statements of rename, e.g. 'sl = Sepal.Length' means the column named as "Sepal.Length" would be renamed to "sl"

.fn

A function used to transform the selected columns. Should return a character vector the same length as the input.

Value

data.table

See Also

rename

Examples

iris %>%
  rename_dt(sl = Sepal.Length,sw = Sepal.Width) %>%
  head()
iris %>% rename_with_dt(toupper)
iris %>% rename_with_dt(toupper,"^Pe")


tidyfst documentation built on Sept. 1, 2022, 5:10 p.m.