I need to find transactions matching some rules.
The following code used to work, but now R recognise %in%
from the base package instead from arules.
matchRules=function(rules,transactions){
id.match=which(transactions %in% rules)
matchedTrx=transactions[id.match]
summary(matchedTrx)
return(matchedTrx)
}
I tried arules::%in%
but it doesn't work.
If I use:
id.match=which(transactions arules::%in% rules)
I get Error:
unexpected symbol in "id.match=which(transactions arules"
Thanks for your help.
Try this instead of %in%, I hope it helps
Try this: