I have a data set as below -
cust cards
a ICICI
a HDFC
a PNB
b ICICI
b PNB
b AMEX
c RCB
c AMEX
d PNB
I want one record for each customer so my output should be like
Cust new_cards
a ICICI,HDFC,PNB
b ICICI,PNB,AMEX
I am using following command -
x = group_by(data,cust)%>% mutate(new_cards=cat(cards,sep=","))
And getting error. Please let me know how can I get the desired output and if I can do this with function as well?