Re: [R] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-14 Thread Michael Hahsler
Hi all, There is no item with the label "". > itemLabels(rules) [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" arules::subset(rules, subset=lhs %pin% "") should return an empty set or throw an error---I will fix that in the next release of arules. To get the rules with 0 elements in

Re: [R] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-13 Thread Tom D. Harray
Hello Luisfo, thank you for the hint: Your suggestion arules::subset(rules, subset=lhs %pin% "") gave 18 rules (out of 21) in my example, and not 3, what I have expected. Surprisingly the negation of the subset condition arules::subset(x = rules, subset = !(lhs %pin% "")) returns the 3

Re: [R] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-13 Thread Luisfo via R-help
Dear Tom, I think this is the line you need arules::subset(rules, subset=lhs %pin% "") I found the solution here: http://stackoverflow.com/questions/27926131/how-to-get-items-for-both-lhs-and-rhs-for-only-specific-columns-in-arules One more thing. For printing the rules, I needed the

[R] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-12 Thread Tom D. Harray
Hello, subsets of association rules (with respect to support, confidence, lift, or items) can be obtained with the arules::subset() function; e.g. rm(list = ls(all.names = TRUE)) library(arules) set.seed(42) x <- lapply(X = 1:500, FUN = function(i) sample(x = 1:10, size =