Concatenate strings by group with dplyr [duplicate]

You could simply do

data %>% 
     group_by(foo) %>% 
     mutate(bars_by_foo = paste0(bar, collapse = "")) 

Without any helper functions

Leave a Comment