These are the aggregating versions of string concatenation—they combine values from a set of rows into a single value.
The bindings for paste() and str_c() might be tricky to implement because when these functions are called with the coallapse argument unset, they do not aggregate.
In summarise() we need to be able to use scalar concatenation within aggregate concatenation, like this:
starwars %>%
filter(!is.na(hair_color) & !is.na(eye_color)) %>%
group_by(homeworld) %>%
summarise(hair_and_eyes = paste0(paste0(hair_color, "-haired and ", eye_color, "-eyed"), collapse = ", "))
Reporter: Ian Cook / @ianmcook
Related issues:
Note: This issue was originally created as ARROW-12711. Please see the migration documentation for further details.