Rename multiple columns
Rename multiple columns with the same transformation
rename_with.(.df, .fn, .cols = everything(), ...)
.df |
A data.table or data.frame |
.fn |
Function to transform the names with. |
.cols |
Columns to rename. Defaults to all columns. |
... |
Other parameters to pass to the function |
test_df <- data.table( x = 1, y = 2, double_x = 2, double_y = 4 ) test_df %>% rename_with.(toupper) test_df %>% rename_with.(~ toupper(.x)) test_df %>% rename_with.(~ toupper(.x), .cols = c(x, double_x))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.