You could simply do
data %>% group_by(foo) %>% mutate(bars_by_foo = paste0(bar, collapse = ""))
Without any helper functions
1.4m articles
1.4m replys
5 comments
57.0k users