I'm using arules packages, and looking for rules I have this problem:
NB: txn is my transactions matrix
You can download here my CSV
library(arules)
txn = read.transactions(file="ItemList.csv", rm.duplicates= FALSE, format="basket",sep=",",cols=1);
txn@itemInfo$labels <- gsub("\"","",txn@itemInfo$labels)
rules <- apriori(txn,
parameter = list(support=.001,
confidence=.5,
minlen=2,
target='rules' # to mine for rules
))
>summary(rules)
... etc
> inspect(sort(rules, by='lift', decreasing = T)[1:5])
Error in slot(x, s)[i] : subscript out of bounds
At the end, My error is
Error in slot(x, s)[i] : subscript out of bounds
I read online that my problem should not come from a "wrong code" but from R settings. Thank you all for your help!
Just solved. Setting Support=0.00001 in rules makes everything work
rules <- apriori(txn,
parameter = list(support=.00001,
confidence=.5,
minlen=2,
target='rules' # to mine for rules
))