-7
require(arules)
Groceries <- read.transactions("C:/Users/IBM_ADMIN/Desktopgroceries.csv",sep=",")

 m1 <- apriori(Groceries,parameter=list(support=0.007,confidence=0.25,minlen=2))

subset.matrix <- is.subset(m1, m1)

#this piece of line is not working

This produces the following error message:

Error in match(x, table, nomatch = 0L) : 
  'match' requires vector arguments

Please do help me.

  • 3
    Your question does not contain a [reproducible example](http://stackoverflow.com/q/5963269/4303162). It is therefore hard to understand your problem and give you an appropriate answer. Please make your data available (e.g. by using `dput()`) or use one of the example data sets in R. Also, add the minimal code required to reproduce your problem to your post. – Stibu Jun 18 '16 at 19:13

1 Answers1

0

apriori returns rules object, not a vector:

data("Adult")
## Mine association rules.
rules <- apriori(Adult, 
    parameter = list(supp = 0.5, conf = 0.9, target = "rules"))
class(rules)
# [1] "rules"

if you want to compare lists of rules you will need to transform this object to a data.frame, e.g.:

rules.df <- as(rules, "data.frame")
is.subset(rules.df$rules, rules.df$rules)
Bulat
  • 6,669
  • 1
  • 27
  • 48