I have a dataset of the format:
txn_id prod_name
223 milk
223 eggs
235 eggs
235 bread
235 butter
I am trying to use this data to find correlation between various products (Market Basket Analysis). For using the Apriori algorithm in R, the data needs to be of the format
| prod_name | prod_name | prod_name |
milk eggs
eggs bread butter
How to achieve this?