Arules package - market basket analysis, missing data

Hi everyone, I am trying to run the market basket analysis with Apriori

The below is my code, but for some reason i cannot get the first item in relation to second item. my LHS column is empty, below are my packages and code. The data is just a basket type data with comma to separate items.

library(arules)
library(arulesViz)
library(RColorBrewer)

tr.women <- read.transactions("women.csv", format = 'basket', sep = ',')
women.rules <- apriori(tr.women , parameter = list(supp=0.001, conf=0.001,maxlen=10))
inspect(women.rules)
write.csv(inspect (women.rules),"C:\Users\xxx\Documents\womenfinal1.csv")

below image is output, red box is where the missing data should be :frowning:
image

EDIT // I found something online and also tried this:

testrules <- apriori(tr.women,
parameter = list(supp=0.001, conf=0.005,
maxlen=2,
minlen=1,
target= "rules"))

but nothing shows up, so i am guessing the transaction type data is recording each line as an item instead of separating my items with comma? I thought sep = ',' was meant for that?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.