Here I want to rename all the cat columns to be cat_1, cat_2, and cat_3 respectively. How do I do this using rename_at?
cat_1
cat_2
cat_3
rename_at
tibble("cat" = "meow", "cats" = "meow", "catss" = "meow", "dog" = "woof") %>% rename_at(vars(starts_with("cat")), .funs = ???)
tibble("cat" = "meow", "cats" = "meow", "catss" = "meow", "dog" = "woof") %>% rename_at(vars(starts_with("cat")), .funs = ~paste0("cat_", 1:length(.)))
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.