Skip to content

[R] Bindings for paste(collapse), str_c(collapse), and str_flatten() #28455

@asfimport

Description

@asfimport

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions