1

いくつかのルールに一致するトランザクションを見つける必要があります。次のコードは以前は機能していましたが、現在はarules%in%からではなくベース パッケージからR を認識します。

matchRules=function(rules,transactions){
  id.match=which(transactions %in% rules)
  matchedTrx=transactions[id.match]
  summary(matchedTrx)

  return(matchedTrx)
}

試しarules::%in%ましたが、うまくいきません。

私が使用する場合:

id.match=which(transactions arules::%in% rules)

エラーが発生します:

unexpected symbol in "id.match=which(transactions arules"

ご協力いただきありがとうございます。

4

2 に答える 2