I have a dataframe as such:
Partner Item
A ab
A ac
A ad
A ed
B ol
B le
C ef
E ab
E ol
E ef
E at
E ok
I want to convert this to:
Partner Col1 Col2 Col3 Col4 Col5
A ab ac ad ed
B ol le
C ef
E ab ol ef at ok
For some context, I am going to be using the arules
package to convert my dataframe to transactions class to call the apriori
algorithm.
The way I want to do this is convert the original dataframe as such. Save it as a separate file, and then call it again using read.transactions
.
Any help would be great, thanks!