rename.dtplyr_step | R Documentation |
These are methods for the dplyr generics rename()
and rename_with()
.
They are both translated to data.table::setnames()
.
## S3 method for class 'dtplyr_step'
rename(.data, ...)
## S3 method for class 'dtplyr_step'
rename_with(.data, .fn, .cols = everything(), ...)
.data |
A |
... |
For For |
.fn |
A function used to transform the selected |
.cols |
< |
library(dplyr, warn.conflicts = FALSE)
dt <- lazy_dt(data.frame(x = 1, y = 2, z = 3))
dt %>% rename(new_x = x, new_y = y)
dt %>% rename_with(toupper)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.