jhp
1
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
?
tibble("cat" = "meow",
"cats" = "meow",
"catss" = "meow",
"dog" = "woof") %>%
rename_at(vars(starts_with("cat")), .funs = ???)
jhp
2
tibble("cat" = "meow",
"cats" = "meow",
"catss" = "meow",
"dog" = "woof") %>%
rename_at(vars(starts_with("cat")), .funs = ~paste0("cat_", 1:length(.)))
2 Likes
system
Closed
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.