I have the next dataframe:
col1<-c("A1","B1","A1","B1","C1","C1","A1")
col2<-c("a","b","c","d","b","f","a")
dat<-data.frame(col1,col2)
From the previous data frame I would like to get something like this:
A1 "ac"
B1 "bd"
C1 "bf"
I mean, I need to aggregate by paste unique values in col 2 grouping the codes in col1.
I was trying something like this
dat%>%group_by(col1)%>%summarise(pp=paste0(col2))
but It doesn't work.