Skip to content
Prev 390997 / 398506 Next

how to rename variables by lopping off first 3 characters

This should work (couldn't check - not at my computer right now):

my_df %<% rename_at(vars(starts_with("i..")), funs(str_replace(., "i..",
"")))

There are also a lot of tutorials on the internet. Google something like
"rename_at str_replace"

HTH,
Stefan

On Mon, Mar 14, 2022, 10:27 Christopher W Ryan via R-help, <
r-help at r-project.org> wrote: