Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rename_dt

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

Examples

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

tidyfst

Tidy Verbs for Fast Data Manipulation

v0.9.9
MIT + file LICENSE
Authors
Tian-Yuan Huang [aut, cre] (<https://orcid.org/0000-0002-3591-4203>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.