I have some data which looks like this (fake data for example\'s sake):
dressId color 6 yellow 9 red 10 green
I am afraid that the answer should be a little different, you should use the following code to accomplish the requested behaviour
df %>% group_by(dressId) %>% summarize(colors = toString(unique(color)))