powered by
Rename with, but Loudly
rename_with_loud(.data, .fn, .cols = everything(), ...)
.data renamed
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details.
A function used to transform the selected .cols. Should return a character vector the same length as the input.
.cols
<tidy-select> Columns to rename; defaults to all columns.
tidy-select
For rename(): <tidy-select> Use new_name = old_name to rename selected variables.
rename()
new_name = old_name
For rename_with(): additional arguments passed onto .fn.
rename_with()
.fn
tb <- tibble::tibble(pop = 10, pop_2020_est = 9, pop_white_2020 = 8, pop_black_2020 = 2) rename_with_loud(tb, \(x) rem_suff(x, '_2020'))
Run the code above in your browser using DataLab