These helpers have been deprecated. Please use rename_with.()
rename_all.(.data, .fun, ...)rename_at.(.data, .vars, .fun, ...)
rename_if.(.data, .predicate, .fun, ...)
A data.frame or data.table
Function to pass
Other arguments for the passed function
vector c()
of bare column names for rename_at.()
to use
Predicate to pass to rename_if.()
# NOT RUN {
test_df <- data.table(
x = 1,
y = 2,
double_x = 2,
double_y = 4)
test_df %>%
rename_with.(~ sub("x", "stuff", .x))
test_df %>%
rename_with.(~ sub("x", "stuff", .x), .cols = c(x, double_x))
# }
Run the code above in your browser using DataLab