I would group by and summarise the various shipment ids into a list, then process that list into a character string. The code below could be somewhat simplified (no interim summary_dt1 for example)
but I made it a little more verbose so its easier to follow.
To complement Nir's answer, if you are only interested in getting the result as a character string, you can directly apply paste0() on the summarise() function.
library(tidyverse)
# Sample data
dt <- tibble(
"Shipment ID" = c("S00001009", "S00001033",
"S00001034","S00001036", "S00001038", "S00001039", "S00001040","S00001041"),
"Job Operator" = c("Wayne Martin", "Wayne Martin", "Emil Manuel",
"Emil Manuel", "Emil Manuel", "Joanne Lano","Joanne Lano" ,"Tony Solis")
)
dt %>%
group_by(`Job Operator`) %>%
summarise(ship_ids = paste0(`Shipment ID`, collapse = ", "))
#> # A tibble: 4 x 2
#> `Job Operator` ship_ids
#> <chr> <chr>
#> 1 Emil Manuel S00001034, S00001036, S00001038
#> 2 Joanne Lano S00001039, S00001040
#> 3 Tony Solis S00001041
#> 4 Wayne Martin S00001009, S00001033
Thank you very much for your assistance! What I was thinking of was what @andresrcs proposed, but this is brilliant, I clearly see the applicability with yours !
If you want to use purr::map_() functions on a pipe you have to do it inside a mutate statement. BTW please stay within the scope of the original reprex or provide a new one.