In transactions, you can have in the itemInfo labels and levels. Could I create rules with "Apriori" using the different levels of the transaction? I would like that certain values in Level1 only appears in the left side of the rule (lhs). I'm only able to select items using the labels.
One example using the public dataset "Groceries":
data("Groceries")
str(Groceries)
str(Groceries@itemInfo)
You can see that Groceries@iteminfo has labels, level2 and level1. I could apply the function apriori for creating rules that only had "whole milk" (one of the labels) on the right side (rhs).
library("arules")
rules<-apriori(data=Groceries, parameter=list(supp=0.001,conf = 0.08),
appearance = list(default="lhs",rhs="whole milk"),
control = list(verbose=F))
inspect(head(rules))
But I don't know how to do the same action based on the different levels (for example, in this example could be "baby food" or " bags") and not in the labels.