I have a subset from a database in csv which has several different columns and I would like to convert the data into transactions. I've already read this post
library(arules)
library(arulesViz)
trans = read.transactions("data.csv", format = "single", sep = ",",
cols = c("EMAIL", "BRAND"))
However wasn't able to convert my data with the proposed solution:
CATEGORY BRAND SKU EMAIL SEGMENT SALES
shorts gap 1564 one@mail.x 1 1
tops gap 8974 one@mail.x 1 2
shoes nike 3245 two@mail.x 4 3
jeans levis 8956 two@mail.x 4 1
Now I want to use arules to understand what brands customers generally buy together. In order to use arules I need to convert my data so it looks as follows:
gap, gap
nike, levis
Can anybody help me figure out how to convert my data accordingly?